Bug 487390 - [Wayland] Frequent changing of Window Icon freezes Plasmashell if TaskManager is present on a panel
Summary: [Wayland] Frequent changing of Window Icon freezes Plasmashell if TaskManager...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (other bugs)
Version First Reported In: 6.1.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: efficiency-and-performance, wayland-only
Depends on:
Blocks:
 
Reported: 2024-05-22 21:28 UTC by thederpyworld
Modified: 2025-07-05 10:46 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
gdb backtrace of plasmashell after it had frozen (12.50 KB, text/plain)
2024-05-22 21:28 UTC, thederpyworld
Details
SDL example that causes the task manager to freeze (1.12 KB, text/x-c++src)
2024-06-23 10:51 UTC, thederpyworld
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thederpyworld 2024-05-22 21:28:57 UTC
Created attachment 169718 [details]
gdb backtrace of plasmashell after it had frozen

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
When playing Fallout 4 (in my case on Steam) in a nested Gamescope instance, the `plasmashell` will freeze after a period of gameplay. This both happens on X11 and Wayland.

In either cases the freeze can be workarounded by removing the task manager (in my case Icons-only) from the panel, or for X11 to use `xprop` to set Gamescope's `_NET_WM_STATE_SKIP_TASKBAR` to `_NET_WM_STATE_SKIP_TASKBAR`, hiding Gamescope from the taskbar.

STEPS TO REPRODUCE
1. Launch Fallout 4 in Gamescope
2. Play the game for a short while
3. Notice that the plasmashell is frozen

OBSERVED RESULT
The freeze can be observed in a few ways:
1. OSD nor notifications are not displaying
2. Volume buttons to nothing
3. The clock on the panel is not updating

EXPECTED RESULT
The shell not to be frozen over.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux 6.9.1-arch1-1
(available in About System)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Last time I played Fallout 4 was around June 2023 (according to my update logs it might have been plasma-desktop 5.27.6-1), where this issue appeared as well, however at that time I chalked it up to NVIDIA being broken for me. However, now that I have more time on hand, it doesn't appear to be so.

In an attempt to help with the debugging, below I am appending a `gdb` backtrace of `plasmashell` when it froze during gameplay.

The command I use to run Gamescope with Steam is as follows:
`gamescope -w 1920 -h 1080 -e -r 120 -- steam -gamepadui`

This might be coming from memory, but there have been times where the plasmashell would unfreeze minutes after Gamescope quit.
Comment 1 thederpyworld 2024-06-23 10:51:24 UTC
Created attachment 170855 [details]
SDL example that causes the task manager to freeze

Compiled with:

g++ `sdl2-config --libs` -g freeze-taskmanager.cpp -o freeze-taskmanager

After running it, a black window should appear which can be closed by either closing the window, pressing Q or ESC.
Comment 3 Fushan Wen 2024-06-24 17:08:17 UTC
Note that as the maintainer of kwin said it's unlikely to add a similar timer in kwin, the bug will not be fixed on Wayland.
Comment 4 Fushan Wen 2024-06-26 17:23:38 UTC
Git commit b36d9b27798b406378ef5d7a6b9b740f3f9013e3 by Fushan Wen.
Committed on 26/06/2024 at 17:04.
Pushed by fusionfuture into branch 'master'.

libtaskmanager: improve efficiency when window icon frequently changes

Don't wipe the whole appData cache entry when only the icon changes
because constructing the cache requires querying all applications
on the local disk.

Add NET::WMIcon to cachable properties as it's usually expensive to
update icons.
FIXED-IN: 6.1.2

M  +3    -2    libtaskmanager/autotests/xwindowtasksmodeltest.cpp
M  +1    -1    libtaskmanager/xwindowsystemeventbatcher.cpp
M  +5    -2    libtaskmanager/xwindowtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/b36d9b27798b406378ef5d7a6b9b740f3f9013e3
Comment 5 Fushan Wen 2024-06-26 17:41:30 UTC
Git commit cd563dff3a5f5b61de0d3142768c47707f8d8e55 by Fushan Wen.
Committed on 26/06/2024 at 17:24.
Pushed by fusionfuture into branch 'Plasma/6.1'.

libtaskmanager: improve efficiency when window icon frequently changes

Don't wipe the whole appData cache entry when only the icon changes
because constructing the cache requires querying all applications
on the local disk.

Add NET::WMIcon to cachable properties as it's usually expensive to
update icons.
FIXED-IN: 6.1.2


(cherry picked from commit b36d9b27798b406378ef5d7a6b9b740f3f9013e3)

Co-authored-by: Fushan Wen <qydwhotmail@gmail.com>

M  +3    -2    libtaskmanager/autotests/xwindowtasksmodeltest.cpp
M  +1    -1    libtaskmanager/xwindowsystemeventbatcher.cpp
M  +5    -2    libtaskmanager/xwindowtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/cd563dff3a5f5b61de0d3142768c47707f8d8e55