Focus induced (?) stutter in native Wayland windows

I’m struggling with an issue whenever I’m playing any fullscreen games that run in a native Wayland window. Every time when:

  • a cursor becomes visible (eg. due to opening in-game chat);
  • a KDE notification is shown on the screen;

my game will drop a few frames when that happens. Here’s how this looks like:

This doesn’t happen to games running via X11/Xwayland. Strangely, it also doesn’t happen when I’m trying to capture it using Spectacle (which shows a frame of the recorded region on-screen while the recording is active), which is why the above is a phone recording. Initially I thought the way the cursor is being shown on the screen is the cause for the problem, but both the notification-induced stutter and the Spectate observation made me think it might be something else - something about the window focus being lost, some layering issue…?

Just in case it could be caused by MangoHUD, I tested the game without it - same issue, a very perceptible stutter in the aforementioned conditions are met.

Is this a known issue? System information below: