Bug 511793 - Stuttering in some games when clicking and releasing mouse.
Summary: Stuttering in some games when clicking and releasing mouse.
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (other bugs)
Version First Reported In: 6.5.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-07 20:17 UTC by mwyeatts
Modified: 2025-12-24 00:41 UTC (History)
4 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 mwyeatts 2025-11-07 20:17:32 UTC
SUMMARY
I have two displays running at different refresh rates (60hz and 165hz). In games such as FFXIV and Cities Skylines, I've noticed when I press the mouse and the cursor disappears, when the cursor reappears there is a stutter/large frame rate drop that occurs. 

Clicking on UI elements that don't cause the cursor to disappear has no stuttering issues.

STEPS TO REPRODUCE
1. Use two displays with different refresh rates.
2. Open FFXIV
3. Click and hold the mouse to move the camera around and release the mouse. 

OBSERVED RESULT
Stuttering when the mouse is released and the cursor reappears.

EXPECTED RESULT
No stuttering

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.2
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7800X3D 8-Core Processor
Memory: 32 GiB of RAM (30.5 GiB usable)
Graphics Processor 1: AMD Radeon RX 7900 XTX
Graphics Processor 2: AMD Ryzen 7 7800X3D 8-Core Processor

ADDITIONAL INFORMATION
Here is a video of the problem: https://youtu.be/siSVaXroBWM

I didn't have this issue in plasma 6.4, or possibility even 6.5.0, but I'm not positive. Here's a few things that fix it in FFXIV.

1. Use a single monitor
2. Enable the software cursor in in-game settings
3. Play in Windowed Mode
4. Use Gamescope
5. Use Sway

Let me know if more information is needed. Thank you.
Comment 1 Simon Kejonen 2025-11-14 09:31:41 UTC
I am having the exact same problem in other games that grabs the cursor like FFXIV. I have tested in Guild Wars 2 and World of Warcraft and the same stutters happen in those as well.

Also using arch with the latest release of everything. Also using a multi-monitor setup, but with the same refresh-rate on both.
Gpu AMD RX 7900XTX
Cpu AMD Ryzen 7 5800X3D
Comment 2 username 2025-11-19 03:18:19 UTC
I think this is related to direct scanout

- direct scanout stops working with MAILBOX and FIFO present modes for a moment when mouse cursor appears and soon later it works again, I can see that "compositing" red text appears for a moment - e.g. press ESC in game to open menu which shows cursor [still regression 6.4.5 -> 6.5.0-git]
https://bugs.kde.org/show_bug.cgi?id=510967#c8
https://www.youtube.com/watch?v=GY_5oT8MFNY
Comment 3 captainskelly0 2025-12-13 09:46:08 UTC
This issue still persists unfortunately. Same situation. In FFXIV if the mouse setting is set to hardware, there will be a massive fps dip for a moment when the cursor comes back after clicking (if you're, perhaps, trying to move the camera). Like OP, I also have a dual monitor setup where my main has 165hz and my second monitor has 60hz. I haven't exactly noticed this issue in any other game (I've been playing games mostly with controller lately) so, FFXIV for now, is the one I know that is having this issue. 

One solution is to set the mouse setting to "software" which causes a tiny delay in movement with the mouse, but otherwise the game runs normally smooth. Hardware mode gives us that frame dip issue. I'd like to use hardware mouse as there's no delay at all with moving the mouse around. 

OS: CachyOS x86_64
Kernel: Linux 6.18.0-3-cachyos
DE: KDE Plasma 6.5.4
WM: KWin (Wayland)
CPU: 12th Gen Intel(R) Core(TM) i5-12600K (16) @ 5.00 GHz
GPU: AMD Radeon RX 6800 XT
Comment 4 william.drumright 2025-12-15 18:29:42 UTC
On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime stalls when right-clicking to control the camera.

This does not occur on NVIDIA hardware.

Environment (affected system)
OS: Archy
KDE Plasma: 6.5.4
Session: Wayland
GPU: AMD RX 7900 XTX
Driver: amdgpu + Mesa
Monitor: 165 Hz
Mouse: 1000 Hz polling
Game runtime: Wine / Proton GE (DXVK)
Game: World of Warcraft WOTLK (legacy client)

Symptoms
Right-clicking to rotate camera causes a visible hitch / microstutter
MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or released

What fixes the issue
KWIN_DRM_NO_DIRECT_SCANOUT=1
→ Completely resolves the stutter and FPS→0 drops

Gamescope
→ Also resolves it, but causes alt-tab issues and occasional mouse/camera desync

Partial workaround
Disabling in-game hardware cursor (adds mouse latency)


Control test (no issue)
Tested on a laptop with NVIDIA GPU using the same game and runtime:
CPU: Intel i7 (12th gen)
GPU: RTX 3070 Ti
OS: Archy
Session: KDE Wayland
Mouse: 1000 Hz polling
Same Wine/Proton GE runner
→ No stutter, no FPS drops, no Gamescope or env vars needed


Likely cause
Appears related to KWin Direct Scanout being invalidated by cursor visibility / pointer grab changes, causing a brief present stall. Disabling Direct Scanout globally avoids the issue.
Comment 5 username 2025-12-16 01:07:40 UTC
KWIN_DRM_NO_DIRECT_SCANOUT=1 workaround doesn't work for me. I still see fps drops to 0 when release mouse button. Did I miss something? Tried adding it to /etc/environment and ~/.config/plasma-workspace/env/

KWin debug console shows "compositing" red text and it not flashing, just static text
Comment 6 captainskelly0 2025-12-16 03:46:26 UTC
(In reply to william.drumright from comment #4)
> On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the
> mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime
> stalls when right-clicking to control the camera.
> 
> This does not occur on NVIDIA hardware.
> 
> Environment (affected system)
> OS: Archy
> KDE Plasma: 6.5.4
> Session: Wayland
> GPU: AMD RX 7900 XTX
> Driver: amdgpu + Mesa
> Monitor: 165 Hz
> Mouse: 1000 Hz polling
> Game runtime: Wine / Proton GE (DXVK)
> Game: World of Warcraft WOTLK (legacy client)
> 
> Symptoms
> Right-clicking to rotate camera causes a visible hitch / microstutter
> MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or
> released
> 
> What fixes the issue
> KWIN_DRM_NO_DIRECT_SCANOUT=1
> → Completely resolves the stutter and FPS→0 drops
> 
> Gamescope
> → Also resolves it, but causes alt-tab issues and occasional mouse/camera
> desync
> 
> Partial workaround
> Disabling in-game hardware cursor (adds mouse latency)
> 
> 
> Control test (no issue)
> Tested on a laptop with NVIDIA GPU using the same game and runtime:
> CPU: Intel i7 (12th gen)
> GPU: RTX 3070 Ti
> OS: Archy
> Session: KDE Wayland
> Mouse: 1000 Hz polling
> Same Wine/Proton GE runner
> → No stutter, no FPS drops, no Gamescope or env vars needed
> 
> 
> Likely cause
> Appears related to KWin Direct Scanout being invalidated by cursor
> visibility / pointer grab changes, causing a brief present stall. Disabling
> Direct Scanout globally avoids the issue.

Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to?
Comment 7 william.drumright 2025-12-16 12:12:01 UTC
(In reply to captainskelly0 from comment #6)
> (In reply to william.drumright from comment #4)
> > On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the
> > mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime
> > stalls when right-clicking to control the camera.
> > 
> > This does not occur on NVIDIA hardware.
> > 
> > Environment (affected system)
> > OS: Archy
> > KDE Plasma: 6.5.4
> > Session: Wayland
> > GPU: AMD RX 7900 XTX
> > Driver: amdgpu + Mesa
> > Monitor: 165 Hz
> > Mouse: 1000 Hz polling
> > Game runtime: Wine / Proton GE (DXVK)
> > Game: World of Warcraft WOTLK (legacy client)
> > 
> > Symptoms
> > Right-clicking to rotate camera causes a visible hitch / microstutter
> > MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or
> > released
> > 
> > What fixes the issue
> > KWIN_DRM_NO_DIRECT_SCANOUT=1
> > → Completely resolves the stutter and FPS→0 drops
> > 
> > Gamescope
> > → Also resolves it, but causes alt-tab issues and occasional mouse/camera
> > desync
> > 
> > Partial workaround
> > Disabling in-game hardware cursor (adds mouse latency)
> > 
> > 
> > Control test (no issue)
> > Tested on a laptop with NVIDIA GPU using the same game and runtime:
> > CPU: Intel i7 (12th gen)
> > GPU: RTX 3070 Ti
> > OS: Archy
> > Session: KDE Wayland
> > Mouse: 1000 Hz polling
> > Same Wine/Proton GE runner
> > → No stutter, no FPS drops, no Gamescope or env vars needed
> > 
> > 
> > Likely cause
> > Appears related to KWin Direct Scanout being invalidated by cursor
> > visibility / pointer grab changes, causing a brief present stall. Disabling
> > Direct Scanout globally avoids the issue.
> 
> Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to?

I may have spoken too soon. While enabling the KWIN_DRM did smooth out the FPS stutter, moving to a busy part of the game causes the mouse to have really bad latency. Going back to GameScope may be the best option until this bug gets addressed upstream.

If you want to test it yourself:

    Create an environment directory and file:
mkdir -p ~/.config/environment.d
nano ~/.config/environment.d/kwin.conf

Add this line to the file:

KWIN_DRM_NO_DIRECT_SCANOUT=1

Log out and back in
Comment 8 username 2025-12-17 02:02:56 UTC
(In reply to william.drumright from comment #7)
> (In reply to captainskelly0 from comment #6)
> > (In reply to william.drumright from comment #4)
> > > On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the
> > > mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime
> > > stalls when right-clicking to control the camera.
> > > 
> > > This does not occur on NVIDIA hardware.
> > > 
> > > Environment (affected system)
> > > OS: Archy
> > > KDE Plasma: 6.5.4
> > > Session: Wayland
> > > GPU: AMD RX 7900 XTX
> > > Driver: amdgpu + Mesa
> > > Monitor: 165 Hz
> > > Mouse: 1000 Hz polling
> > > Game runtime: Wine / Proton GE (DXVK)
> > > Game: World of Warcraft WOTLK (legacy client)
> > > 
> > > Symptoms
> > > Right-clicking to rotate camera causes a visible hitch / microstutter
> > > MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or
> > > released
> > > 
> > > What fixes the issue
> > > KWIN_DRM_NO_DIRECT_SCANOUT=1
> > > → Completely resolves the stutter and FPS→0 drops
> > > 
> > > Gamescope
> > > → Also resolves it, but causes alt-tab issues and occasional mouse/camera
> > > desync
> > > 
> > > Partial workaround
> > > Disabling in-game hardware cursor (adds mouse latency)
> > > 
> > > 
> > > Control test (no issue)
> > > Tested on a laptop with NVIDIA GPU using the same game and runtime:
> > > CPU: Intel i7 (12th gen)
> > > GPU: RTX 3070 Ti
> > > OS: Archy
> > > Session: KDE Wayland
> > > Mouse: 1000 Hz polling
> > > Same Wine/Proton GE runner
> > > → No stutter, no FPS drops, no Gamescope or env vars needed
> > > 
> > > 
> > > Likely cause
> > > Appears related to KWin Direct Scanout being invalidated by cursor
> > > visibility / pointer grab changes, causing a brief present stall. Disabling
> > > Direct Scanout globally avoids the issue.
> > 
> > Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to?
> 
> I may have spoken too soon. While enabling the KWIN_DRM did smooth out the
> FPS stutter, moving to a busy part of the game causes the mouse to have
> really bad latency. Going back to GameScope may be the best option until
> this bug gets addressed upstream.
> 
> If you want to test it yourself:
> 
>     Create an environment directory and file:
> mkdir -p ~/.config/environment.d
> nano ~/.config/environment.d/kwin.conf
> 
> Add this line to the file:
> 
> KWIN_DRM_NO_DIRECT_SCANOUT=1
> 
> Log out and back in

Still didn't work for me. I use KDE Wayland/Proton GE 10.26/RX 6900 XT if it matters.

Currenlty the best workaroud I found is to keep Battle.net Launcher running in system tray. It blocks direct scanout because of this https://bugs.kde.org/show_bug.cgi?id=513203
Comment 9 captainskelly0 2025-12-17 02:06:30 UTC
(In reply to william.drumright from comment #7)
> (In reply to captainskelly0 from comment #6)
> > (In reply to william.drumright from comment #4)
> > > On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the
> > > mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime
> > > stalls when right-clicking to control the camera.
> > > 
> > > This does not occur on NVIDIA hardware.
> > > 
> > > Environment (affected system)
> > > OS: Archy
> > > KDE Plasma: 6.5.4
> > > Session: Wayland
> > > GPU: AMD RX 7900 XTX
> > > Driver: amdgpu + Mesa
> > > Monitor: 165 Hz
> > > Mouse: 1000 Hz polling
> > > Game runtime: Wine / Proton GE (DXVK)
> > > Game: World of Warcraft WOTLK (legacy client)
> > > 
> > > Symptoms
> > > Right-clicking to rotate camera causes a visible hitch / microstutter
> > > MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or
> > > released
> > > 
> > > What fixes the issue
> > > KWIN_DRM_NO_DIRECT_SCANOUT=1
> > > → Completely resolves the stutter and FPS→0 drops
> > > 
> > > Gamescope
> > > → Also resolves it, but causes alt-tab issues and occasional mouse/camera
> > > desync
> > > 
> > > Partial workaround
> > > Disabling in-game hardware cursor (adds mouse latency)
> > > 
> > > 
> > > Control test (no issue)
> > > Tested on a laptop with NVIDIA GPU using the same game and runtime:
> > > CPU: Intel i7 (12th gen)
> > > GPU: RTX 3070 Ti
> > > OS: Archy
> > > Session: KDE Wayland
> > > Mouse: 1000 Hz polling
> > > Same Wine/Proton GE runner
> > > → No stutter, no FPS drops, no Gamescope or env vars needed
> > > 
> > > 
> > > Likely cause
> > > Appears related to KWin Direct Scanout being invalidated by cursor
> > > visibility / pointer grab changes, causing a brief present stall. Disabling
> > > Direct Scanout globally avoids the issue.
> > 
> > Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to?
> 
> I may have spoken too soon. While enabling the KWIN_DRM did smooth out the
> FPS stutter, moving to a busy part of the game causes the mouse to have
> really bad latency. Going back to GameScope may be the best option until
> this bug gets addressed upstream.
> 
> If you want to test it yourself:
> 
>     Create an environment directory and file:
> mkdir -p ~/.config/environment.d
> nano ~/.config/environment.d/kwin.conf
> 
> Add this line to the file:
> 
> KWIN_DRM_NO_DIRECT_SCANOUT=1
> 
> Log out and back in

Yeah I tried it myself and it removed most of the stutter but it’s still kinda there. So it’s helped but not completely. Using software mouse in the meantime till this gets fixed. So annoying!
Comment 10 william.drumright 2025-12-20 23:06:34 UTC
Try this! I'm not sure if its placebo but it seems to me it works better than KWIN_DRM_NO_DIRECT_SCANOUT=1

Open your environment file: sudo nano /etc/environment

Add this line:
KWIN_DRM_NO_AMS=1

Save and Reboot. This forces KWin to use a legacy DRM API that often handles input interrupts more smoothly.
Comment 11 username 2025-12-21 00:17:08 UTC
(In reply to william.drumright from comment #10)
> Try this! I'm not sure if its placebo but it seems to me it works better
> than KWIN_DRM_NO_DIRECT_SCANOUT=1
> 
> Open your environment file: sudo nano /etc/environment
> 
> Add this line:
> KWIN_DRM_NO_AMS=1
> 
> Save and Reboot. This forces KWin to use a legacy DRM API that often handles
> input interrupts more smoothly.

KWIN_DRM_NO_AMS=1 causes crash on my system beacause of this: https://bugs.kde.org/show_bug.cgi?id=512968#c6
Comment 12 captainskelly0 2025-12-24 00:41:58 UTC
I hope this issue gets looked into soon, this is just so annoying. Still just using the software mouse but I'd really love this to be fixed :/