Bug 484797

Summary: New wayland mouse warp cursor flickers and skips when it is captive to certain applications
Product: [Plasma] kwin Reporter: Daniel Ellis <ninjaquick>
Component: inputAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: Robingrieves91
Priority: NOR    
Version: 6.0.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Video showing the cursor being weird
Flickering while moving through menus
Moving cursor in straight lines - cursor jumps around
kwin 6.1.3 Star Citizen

Description Daniel Ellis 2024-03-31 06:09:38 UTC
Created attachment 167973 [details]
Video showing the cursor being weird

https://invent.kde.org/plasma/kwin/-/issues/85

SUMMARY

The mouse cursor flickers while in motion in Star Citizen, which was previously affected by the camera-snapping bug which has been resolved with the recent mouse-warp commit:

https://invent.kde.org/plasma/kwin/-/commit/630ba5fab4b02c2b496553c79d4a315da9271b53

- This doesn't affect all areas (menus appear unaffected)
- The cursor behaves "normally" when moving the cursor over the game window when it is unfocused
- Having a few windows open in the background seems to make the issue more pronounced

STEPS TO REPRODUCE
1. Launch a game that was previously affected by the snap-to-bottom-left issue (i.e Star Citizen)
2. Summon the cursor (i.e. F while in first person in star citizen OR open the inventory (I)
3. Observe where the cursor appeared
4. Summon the cursor again, observe
5. Repeat 2-4 a few times

OBSERVED RESULT
The cursor appears in different locations

EXPECTED RESULT
The cursor is consistently centered

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.0.3
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
VRR is active, the framerate is relatively high - the cursor is flickering *a lot*.
The input is smooth in the video, but the cursor can be skipping multiple times
Comment 1 Daniel Ellis 2024-03-31 06:11:55 UTC
Created attachment 167974 [details]
Flickering while moving through menus
Comment 2 Daniel Ellis 2024-03-31 06:15:30 UTC
Created attachment 167975 [details]
Moving cursor in straight lines - cursor jumps around
Comment 3 Rob Grieves 2024-07-14 06:26:30 UTC
Any updates? Issue is still present in 6.1.2
Comment 4 Daniel Ellis 2024-07-20 22:58:11 UTC
Created attachment 171847 [details]
kwin 6.1.3 Star Citizen
Comment 5 Daniel Ellis 2024-07-20 23:07:25 UTC
(In reply to Rob Grieves from comment #3)
> Any updates? Issue is still present in 6.1.2

Attached a video of the behavior in 6.1.3
Based on feedback from the star citizen Linux user group community this is apparently more noticeable in 32:9, and from my testing that seems to be the case. 16:9 works and the behavior deteriorates as the format gets wider. Windows users do not experience this issue (at least anecdotally, I have asked 10 or so Windows users with 32:9 screens and they have all reported that there were no issues with the cursor behavior).

I am not sure which other software presents this issue. I don't see this in hyprland either but similar issues were present in gamescope with the wayland backend.

The strangest thing is that the cursor behaves perfectly when in 2D menus (escape menu, main menu) and the 3D "mobiglass" menu. If it wasn't for the fact that the issue doesn't appear to happen in hyprland or Windows I would chalk it up to a developer bug.

A last thing of note is that if I move the cursor very slowly the issue goes away.
Comment 6 Rob Grieves 2024-07-21 00:38:48 UTC
(In reply to Daniel Ellis from comment #5)
> (In reply to Rob Grieves from comment #3)
> > Any updates? Issue is still present in 6.1.2
> 
> Attached a video of the behavior in 6.1.3
> Based on feedback from the star citizen Linux user group community this is
> apparently more noticeable in 32:9, and from my testing that seems to be the
> case. 16:9 works and the behavior deteriorates as the format gets wider.
> Windows users do not experience this issue (at least anecdotally, I have
> asked 10 or so Windows users with 32:9 screens and they have all reported
> that there were no issues with the cursor behavior).
> 
> I am not sure which other software presents this issue. I don't see this in
> hyprland either but similar issues were present in gamescope with the
> wayland backend.
> 
> The strangest thing is that the cursor behaves perfectly when in 2D menus
> (escape menu, main menu) and the 3D "mobiglass" menu. If it wasn't for the
> fact that the issue doesn't appear to happen in hyprland or Windows I would
> chalk it up to a developer bug.
> 
> A last thing of note is that if I move the cursor very slowly the issue goes
> away.

Thanks Daniel. I'm on 16:9 4K and it's bad. Like can't use inventory or intractable screens bad. There's a lot of discussion about it in this gamescope bug which might help. Sounds like same root cause but symptoms present differently in gamescope vs kwin. https://github.com/ValveSoftware/gamescope/issues/1319#issuecomment-2238844002