[SOLVED] Have you ever experienced stuttering in a game if you receive a message in a desktop messaging app during gameplay?
Solution
This is a bug in KDE Plasma [1.1][2]. It appears that it might be fixed in KDE Plasma v6.2 [1.2][3].
Original Post
I have noticed this behavior with Element and Signal while playing Deadlock. The game will have a pretty severe stutter, ie the frame-rate will substantially dip, for half a second or so at the exact moment that a message is received. It seems to happen with every message. Do note that these are only messages that would result in a system notification. All other messages that are silent, ie they have no pop-up notification, do not result in any stutter.
OS: Arch Linux, Kernel: v6.6.49-1-lts
DE: KDE Plasma v6.1.4
WM: Wayland
CPU: Intel Core i5-4690k
GPU: AMD Radeon RX 6600
Updates
I have tried disabling this setting in Deadlock:
I have tried windowed-borderless
I have noticed that the moment that the stutter occurs, my CPU spikes maybe 20% and my GPU drops to 0%.
There are some remaining code paths that can block direct scanout - namely effects that haven't been fixed, or that may need to block direct scanout in some situations. There's a new API in 6.2 that effects can use though, https://invent.kde.org/plasma/kwin/-/merge_requests/6203, which blocks direct scanout only when really necessary. It's implemented for all built in effects, and external javascript effects automatically make use of this API too.
I think there is a setting in some games where the FPS lowers when not focused, to save system resources. It happens with notifications for a lot of games I play too