Bug 494344

Summary: kwin freezes the desktop on hovering items in Icons Only Task Manager (X11 and Wayland)
Product: [Plasma] kwin Reporter: Waqar Ahmed <waqar.17a>
Component: X11 IntegrationAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: grave CC: kde, nate, nathroset
Priority: NOR    
Version First Reported In: 6.1.5   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: flamegraph
perfparser file
kwin freezes when hovering previews
disabling the second option makes the issue disappear
new perfparser file

Description Waqar Ahmed 2024-10-09 12:14:23 UTC
Created attachment 174568 [details]
flamegraph

SUMMARY

I have been noticing constant cpu spikes whenever I hovered over an icon in the task manager to see the contents of its window temporarily. Its so bad that it freezes the entire desktop for 5-10 seconds.


I am attaching a perfparser file which can be opened in kdab/hotspot and also attaching a flamegraph svg.
Comment 1 Waqar Ahmed 2024-10-09 12:16:19 UTC
Created attachment 174569 [details]
perfparser file

perfparser file. It can be opened in kdab hotspot
Comment 2 Waqar Ahmed 2024-10-09 12:20:03 UTC
Restarting kwin made it faster again:

systemctl restart --user plasma-kwin_x11.service
Comment 3 Nate Graham 2024-11-13 19:39:51 UTC
Are you really using Plasma 6.0.5? I would strongly recommend upgrading. Also, what distro are you using it on?
Comment 4 Waqar Ahmed 2024-11-14 07:40:36 UTC
I am now on 6.1.5. I am using Manjaro

The bug still happens from time to time.

Operating System: Manjaro Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.6.54-2-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 7 4700U with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 81X2
System Version: IdeaPad Flex 5 14ARE05
Comment 5 Nate Graham 2024-11-14 14:50:32 UTC
Thanks. Does it happen in the Wayland session?
Comment 6 Waqar Ahmed 2025-01-28 05:48:35 UTC
I do not use Wayland so I am not sure. 

Can confirm its still happening as of:

Operating System: Manjaro Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.1
Kernel Version: 6.6.65-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 7 4700U with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 7 Nate Graham 2025-01-28 15:02:52 UTC
Can you try on Wayland and see?
Comment 8 Waqar Ahmed 2025-01-28 16:06:26 UTC
I can try sometime, but I can't use wayland because it doesn't have autotype into windows functionality last I checked which I need for work, and thus I can't use it for longer periods of time which means hitting this bug will be a lot difficult. This bug happens once I have been using my laptop for a while. I am not sure how big a "while" is, but its at least a few hours.

Also, I have attached profiling information so someone who knows the KWin code / task manager code can at least check the trace to see if something bad is going on like for e.g., accumulating too much data or doing the same work too many times etc.
Comment 9 Nath ROSET 2025-02-07 03:39:29 UTC
I can also reproduce this bug on the Wayland session, so this isn't X11 exclusive. The issue manifests itself over time to the point where my session becomes totally unresponsive and I'm forced to reset.

Operating System: Kubuntu 24.10
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.6.2
Kernel Version: 6.11.0-9-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 31.2 Gio of RAM
Graphics Processor: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 82JU
System Version: Legion 5 15ACH6H
Comment 10 Nath ROSET 2025-02-08 05:16:52 UTC
Created attachment 178065 [details]
kwin freezes when hovering previews

I've captured what the bug looks like : the entire screen freezes when I hover a preview.
However the bug doesn't manifest itself when I disable the "Hide other windows when hovering the preview" option in Appearence > General
Comment 11 Nath ROSET 2025-02-08 05:21:01 UTC
Created attachment 178066 [details]
disabling the second option makes the issue disappear

Disabling the second option in the appearance > general options does not trigger the bug, so use this as a workaround for now if you're affected.
Comment 12 Waqar Ahmed 2025-07-07 12:15:30 UTC
Still an issue with plasma 6.3.5
Comment 13 Vlad Zahorodnii 2025-07-08 08:43:31 UTC
(In reply to Waqar Ahmed from comment #12)
> Still an issue with plasma 6.3.5

Can you please get kwin's backtrace when it's frozen? Otherwise I'm afraid the issue is not actionable. Also please check kwin's logs. Maybe there's something
Comment 14 Bug Janitor Service 2025-07-23 03:46:55 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 15 Waqar Ahmed 2025-07-24 14:25:01 UTC
> Can you please get kwin's backtrace when it's frozen? Otherwise I'm afraid the issue is not actionable

Did you take a look at the flamegraph? That has a sort of backtrace in it, Is there nothing actionable there?

I will take a look at the logs sure.
Comment 16 Waqar Ahmed 2025-07-24 14:25:34 UTC
The perfparser file can be viewed in https://github.com/KDAB/hotspot/
Comment 17 Waqar Ahmed 2025-08-19 12:53:56 UTC
Created attachment 184251 [details]
new perfparser file

Recorded a new trace, it can be viewed in KDAB Hotspot. The summary is that there are too many calls to QElapsedTimer::elapsed() for some reason.

#0 (42.4%) aggregated cycles:P costs in QElapsedTimer::elapsed() const (libQt6Core.so.6.9.1)
#1 (45.7%) aggregated cycles:P costs in KWin::AnimationEffect::updateLayerRepaints() (libkwin.so.6.3.6)
#2 (46.5%) aggregated cycles:P costs in KWin::AnimationEffect::triggerRepaint() (libkwin.so.6.3.6)
#3 (46.6%) aggregated cycles:P costs in KWin::AnimationEffect::p_animate(KWin::EffectWindow*, KWin::AnimationEffect::Attribute, unsigned int, int, KWin::FPx2, QEasingCurve const&, int, KWin::FPx2, bool, bool, bool, KWin::GLShader*) (libkwin.so.6.3.6)
Comment 18 Waqar Ahmed 2025-08-19 12:57:05 UTC
kwin version is: kwin 6.3.6

There is nothing in journalctl, no logs from kwin when the slowness happens. Is there any other place that kwin logs?
Comment 19 Juhani 2025-08-19 14:09:00 UTC
Hello,

I can confirm this bug on my system as well. Here are my system details:
- Operating System: Fedora Linux 41
- Kernel: 6.14.6-200.fc41.x86_64
- KDE Plasma Version: 6.3.5
- Graphics Platform: Wayland
- GPU: Intel Meteor Lake-P [Intel Graphics] (driver: i915)
- Computer: ThinkPad T16 Gen 3

The system consistently freezes for 2-3 seconds with kwin_wayland spiking to nearly 100% CPU. This happens when I hover over the application preview or tooltip popup that appears after hovering a task manager icon.

I have found a workaround by disabling the informational tooltips in System Settings. The freezes no longer occur after making this change.

Steps to reproduce:
1. Use the default KDE Task Manager on a Wayland session.
2. Hover over an application icon to make a popup appear.
3. Move the mouse cursor over the popup itself.
4. The system will freeze, and kwin_wayland CPU usage will spike.

Workaround:
Disable "Display informational tooltips on mouse over" in System Settings -> Workspace -> General Behavior.

This confirms the bug is likely tied to the rendering of these specific UI elements. Hope this helps.
Comment 20 Vlad Zahorodnii 2025-10-08 13:08:34 UTC
Can you run bustle to see what dbus traffic looks like?
Comment 21 David Redondo 2025-10-08 13:10:54 UTC
Theory is that fast repaints triggered by highlightwindows effect through taskmanager

which was enabled by default for a whole but disabled in 6.4.1 https://invent.kde.org/plasma/plasma-desktop/-/commit/5d0f0926846090e2f60d45f97f944f4d791f9198

Does it still happen with plasma 6.4.1 or later?
Comment 22 Nath ROSET 2025-10-08 15:03:23 UTC
(In reply to David Redondo from comment #21)
> Theory is that fast repaints triggered by highlightwindows effect through
> taskmanager
> 
> which was enabled by default for a whole but disabled in 6.4.1
> https://invent.kde.org/plasma/plasma-desktop/-/commit/
> 5d0f0926846090e2f60d45f97f944f4d791f9198
> 
> Does it still happen with plasma 6.4.1 or later?

Hello, 

I cannot reproduce the bug anymore on 6.4.5.

Operating System: Arch Linux 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.17.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen AI 9 HX 370 w/ Radeon 890M
Memory: 32 Gio of RAM (30.5 Gio usable)
Graphics Processor: AMD Radeon 890M Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ASUS Zenbook S 16 UM5606WA_UM5606WA
System Version: 1.0