Bug 513397 - Desktop-wide stuttering when resizing certain Wayland clients
Summary: Desktop-wide stuttering when resizing certain Wayland clients
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.5.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-15 13:45 UTC by fililip
Modified: 2025-12-19 14:38 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fililip 2025-12-15 13:45:57 UTC
SUMMARY
When resizing certain Wayland clients, there are some desktop-wide stutters visible, especially at 200% display scale. This does not affect some clients, like Chromium, Zed (IDE), Signal, EasyEffects (the new Qt/Kirigami UI), when launched using their Wayland backends or X11 applications.

STEPS TO REPRODUCE
1. Use a high-resolution monitor (preferably 2160p) and set its scaling to 200%
2. Open https://www.vsynctester.com in Chromium (Firefox is unfortunately not suitable for this test) or a similar adequate presentation measuring tool (weston-presentation-shm will work too but it could be a bit harder to see the issue there)
3. Keep the graph and the scrolling image visible
4. Open an affected app and make sure it's a Wayland client, not an X11 one (i.e. Firefox, GIMP3, OBS Studio, qBittorrent, I have compiled a more complete list at the end)
5. Resize it in a fast way for a while, try to make the window as large as possible too

OBSERVED RESULT
The graph shows severe frame time fluctuations and the scrolling image stutters, especially when resizing large windows, it's less problematic with smaller ones but still visible nonetheless

EXPECTED RESULT
Nothing stutters at all, like with the unaffected apps listed below

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.18.1-arch1-2 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 64 GiB of RAM (62.7 GiB usable)
Graphics Processor: AMD Radeon RX 9070
Displays: 3840x2160@160Hz at 200%, 1920x1080@120Hz at 100%

ADDITIONAL INFORMATION
My hypothesis is the clients that don't cause stutter are fully GPU accelerated, whereas those that do are mostly CPU-rendered, but OBS Studio might disprove that if it's fully GPU accelerated too (it crashes on a GPU reset but that might only be due to the preview part).

I have compiled some app data as well.

Apps that cause stutter when resizing:
- Firefox
- GIMP3
- Thunderbird
- PulseAudio Volume Control (Qt)
- OBS Studio
- qBittorrent
- qpwgraph

Apps that don't cause stutter no matter how large their windows are at the time of their resizing:
- Zed (IDE)
- EasyEffects (here only the app window is laggy when resizing, but it doesn't affect anything else)
- pwvucontrol
- Chromium
- signal-desktop or any Electron/CEF app (with --ozone-platform=wayland)
- X11 applications, even if their resizing is slow

Previously I thought my RX 6600 XT was too weak for 2160p for some reason but now that my new 9070 does the same thing it obviously can't be that.
Comment 1 fililip 2025-12-17 21:18:26 UTC
Note: setting QT_WIDGETS_RHI=1 and GDK_GL=always makes the stuttering go away.
Comment 2 Oliver Beard 2025-12-18 23:44:37 UTC
This seems to be somewhat reproducible for me. With vsynctester.com open in Chromium, and resizing a Firefox window, I see the graph become unstable. Resizing a Welcome Center window does not.
Comment 3 fililip 2025-12-19 14:38:42 UTC
I discussed it on the KWin Matrix channel and it seems to be an issue with shm vs dmabuf clients. Dmabuf clients don't cause unnecessary buffer copies between the CPU and GPU, unlike shm ones. It might be possible to optimize this a bit, but it's a lot of work and might not be worth it.

Firefox uses shm for its window/decorations, but for the rest it uses dmabuf. This issue goes away with GDK_GL=always, but it causes a GPU reset handling regression (probably due to GTK not implementing it correctly with that env var set), and possibly more issues that I did not run into when testing this.

The equivalent for Qt Widget apps is QT_WIDGETS_RHI=1, which also fixes the issue but introduces a glitch with menus and also prevents successful recovery after a GPU reset with Qt apps like qBittorrent. Also, setting that env var for KWin causes a crash when right-clicking any titlebar or pressing Alt+F3 - this doesn't happen if only applications receive the variable.

Chromium, Zed, etc. use dmabuf for everything and so the stutters don't occur there. Chromium gracefully handles GPU resets, so that means it can work just fine even with that in the picture.

So it's difficult to say if this can be labeled as an upstream bug or a KWin bug.