Bug 482632 - Mouse look stuck in some xwayland applications (specifically games under proton)
Summary: Mouse look stuck in some xwayland applications (specifically games under proton)
Status: RESOLVED DUPLICATE of bug 482476
Alias: None
Product: kwin
Classification: Plasma
Component: libinput (show other bugs)
Version: 6.0.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
: 482239 482837 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-07 03:30 UTC by tylerkstrayhan
Modified: 2024-04-04 23:06 UTC (History)
16 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tylerkstrayhan 2024-03-07 03:30:50 UTC
SUMMARY
***
Mouse look stuck in center of screen in xwayland applications, specifically being games under proton. 


STEPS TO REPRODUCE
1.  Launch a game using proton
2. Try to move mouse

OBSERVED RESULT
Mouse stays stationary with little wiggle movement in center of screen

EXPECTED RESULT
Mouse should follow input of movement around screen

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.7.6-arch1-2
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3

ADDITIONAL INFORMATION
Games attempted:
Cyberpunk 2077
Helldivers 2
Comment 1 alex 2024-03-07 05:10:26 UTC
Same issue here, on two different games (Risk of Rain 2, Lethal Company). Also on Arch Linux (6.7.8-arch1-1) and Plasma 6.0.1.
Comment 2 gfunk 2024-03-07 21:34:10 UTC
similar issue, in 1st/3rd person games, I can only look around the span of my desktop window e.g. 180° horizontal and 90° vertical.. does not always happen, seems to happen if a few applications are open, can sometimes be fixed by alt tabbing out and in?

Dead by Daylight using proton 8 (game does not launch with proton 9 )
Comment 3 aqduck 2024-03-07 22:25:26 UTC
Same issue. 

Arch 6.7.8-Zen
Plasma 6.0.1
Wayland

The first game I tried was Hitman 3 and the mouse worked almost perfectly in the menu, it would occasionally move to 0,0 (top-left corner) as if I had a controller connected, but the UI elements didn't change as they would with controller. As soon as I got into a level the camera was just freaking out as if I had 10000 dpi if I tried to move the mouse.
Second game I tried was Cyberpunk 2077 and in there I noticed it immediately in the menu, except it was in the middle of the screen or middle of whatever object I selected.

Tabbing out caused Plasma to completely freeze so I couldn't try that.

After some looking around I found that it *could* be VRR related, however disabling that in Kwin does nothing in the games. 
I also found that you could try and put `KWIN_DRM_NO_AMS=1` in /etc/environment (and reboot), but again it did nothing but make my mouse feel a bit off (or just placebo).
Comment 4 tylerkstrayhan 2024-03-08 05:31:09 UTC
Those with erradict mouse moves are you using fractional scaling? I'm seeing some people talk about that as well, but thinking the erradict mouse movement and the "stuck" movement I described may be two different issues.
Comment 5 Nicolas Fella 2024-03-08 09:19:10 UTC
*** Bug 482837 has been marked as a duplicate of this bug. ***
Comment 6 aqduck 2024-03-08 18:24:40 UTC
(In reply to tylerkstrayhan from comment #4)
> Those with erradict mouse moves are you using fractional scaling? I'm seeing
> some people talk about that as well, but thinking the erradict mouse
> movement and the "stuck" movement I described may be two different issues.

I think the Hitman issue where the camera freaks out is because the game's 0,0 position for the mouse is top left while Cyberpunk's is in the center of the screen (or whatever object is selected). 
I have the normal 100% scale.
Comment 7 Marco 2024-03-08 20:23:04 UTC
Same for me on Plasma 6 and Wayland. No fractional scaling enabled. Testing now with X11 and reporting back shortly.
Comment 8 Marco 2024-03-08 20:24:36 UTC
(In reply to Marco from comment #7)
> Same for me on Plasma 6 and Wayland. No fractional scaling enabled. Testing
> now with X11 and reporting back shortly.

Works 100% with X11. It seems a Wayland specific bug.
Comment 9 aqduck 2024-03-08 20:26:02 UTC
Made a report on Proton's github page too if it's a Proton issue: https://github.com/ValveSoftware/Proton/issues/7564
Comment 10 tylerkstrayhan 2024-03-08 21:54:59 UTC
(In reply to aqduck from comment #6)
> (In reply to tylerkstrayhan from comment #4)
> > Those with erradict mouse moves are you using fractional scaling? I'm seeing
> > some people talk about that as well, but thinking the erradict mouse
> > movement and the "stuck" movement I described may be two different issues.
> 
> I think the Hitman issue where the camera freaks out is because the game's
> 0,0 position for the mouse is top left while Cyberpunk's is in the center of
> the screen (or whatever object is selected). 
> I have the normal 100% scale.
Ok, that reasoning makes sense. 

(In reply to Marco from comment #8)
> (In reply to Marco from comment #7)
> > Same for me on Plasma 6 and Wayland. No fractional scaling enabled. Testing
> > now with X11 and reporting back shortly.
> 
> Works 100% with X11. It seems a Wayland specific bug.
Yes, for sure related to Wayland and specifically KDE Kwin. Opening same games on KDE 6 X11, no issue. Opening same games on Gnome 45 Wayland, also no issue.
Comment 11 rejedai 2024-03-09 09:28:01 UTC
I have an assumption that the problem will go away with the release of qt 6.7. Because I was using kde6 (wayland) since beta and it used qt 6.7-beta, in the release qt 6.6.
Comment 12 Marco 2024-03-09 09:29:56 UTC
(In reply to rejedai from comment #11)
> I have an assumption that the problem will go away with the release of qt
> 6.7. Because I was using kde6 (wayland) since beta and it used qt 6.7-beta,
> in the release qt 6.6.

Any upstream bug in the QT bug tracker to follow that you found?
Comment 13 rejedai 2024-03-09 09:32:57 UTC
(In reply to Marco from comment #12)
> Any upstream bug in the QT bug tracker to follow that you found?

No, I just haven't observed such problems in beta and rc.
Comment 14 tylerkstrayhan 2024-03-10 00:29:53 UTC
(In reply to rejedai from comment #13)
> (In reply to Marco from comment #12)
> > Any upstream bug in the QT bug tracker to follow that you found?
> 
> No, I just haven't observed such problems in beta and rc.

I tired updating qt in the kde-unstable repo on arch and it ended up just breaking plasma for me. Is there another package it needs to get running?
Comment 15 rejedai 2024-03-10 06:31:04 UTC
(In reply to tylerkstrayhan from comment #14)
> I tired updating qt in the kde-unstable repo on arch and it ended up just
> breaking plasma for me. Is there another package it needs to get running?

You need to rebuild all KDE applications. During beta and rс, KDE packages were automatically built on qt 6.7.
Comment 16 David Edmundson 2024-03-10 15:06:41 UTC
*** Bug 482239 has been marked as a duplicate of this bug. ***
Comment 17 tylerkstrayhan 2024-03-10 19:42:24 UTC
(In reply to rejedai from comment #15)
> (In reply to tylerkstrayhan from comment #14)
> > I tired updating qt in the kde-unstable repo on arch and it ended up just
> > breaking plasma for me. Is there another package it needs to get running?
> 
> You need to rebuild all KDE applications. During beta and rс, KDE packages
> were automatically built on qt 6.7.

Hm, did that as well, but it immediately crashes on login.
Comment 18 tylerkstrayhan 2024-03-11 02:47:12 UTC
So after some more testing, I have gotten both of these games to function properly. I have a nvidia GPU, so I added nvidia_drm.fbdev=1 to my systemd boot config and now mouselook is working.
Comment 19 Oleh 2024-03-11 07:31:21 UTC
It happens to me with 50% chance in proton games in fullscreen, borderless and even windowed mode. No scaling, single monitor, 800 DPI mouse, Plasma 6.0.1, wayland, amdgpu
Comment 20 David Edmundson 2024-03-11 10:13:10 UTC

*** This bug has been marked as a duplicate of bug 452188 ***
Comment 21 tylerkstrayhan 2024-03-11 14:10:24 UTC
(In reply to David Edmundson from comment #20)
> 
> *** This bug has been marked as a duplicate of bug 452188 ***

Is this bug a duplicate of that? That issue was reported in 5.24. Myself and seems many others had this mouse stuck issue since 6.0.
Comment 22 aqduck 2024-03-11 15:38:08 UTC
Mine's working now on Arch after I did an update yesterday!
Not sure what did it but I'm still on qt 6.6.2

Just Cyberpunk tested for now
Comment 23 Marco 2024-03-12 09:33:31 UTC
(In reply to aqduck from comment #22)
> Mine's working now on Arch after I did an update yesterday!
> Not sure what did it but I'm still on qt 6.6.2
> 
> Just Cyberpunk tested for now

Can confirm the same on my arch linux install after an update. Might be already found and gone, but I'll keep testing later.
Comment 24 aqduck 2024-03-12 23:22:26 UTC
(In reply to Marco from comment #23)
> (In reply to aqduck from comment #22)
> > Mine's working now on Arch after I did an update yesterday!
> > Not sure what did it but I'm still on qt 6.6.2
> > 
> > Just Cyberpunk tested for now
> 
> Can confirm the same on my arch linux install after an update. Might be
> already found and gone, but I'll keep testing later.

I take that back, it stopped working again.
Comment 25 aqduck 2024-03-13 13:32:13 UTC
Ok, I have absolutely no idea what's causing it, but I was able to reproduce it once today.

Things I tried (Cyberpunk 2077):

[Before starting game]:
* Switched desktop
* Used the cube
* Used desktop "grid" (which is no longer a grid, but that's an unrelated bug)
* Launched application dashboard (another monitor)
* Locked the screen
* Suspended the system
* Entered tiling editor
* Moved Steam to different desktop
* Clicked on the desktop and another monitor while the game was launching
* Used a custom shortcut (Alt+R) for a script that runs a pretty niche screen recorder called "GPU-Screen-Recorder" (this one did coincide with the mouse locking up ingame, but only once so probably just coincidence. It captures directly from the GPU, and the GPU used to render the game is a different one)

After a reboot I redid the above but in backwards order (and the GSR scripts a few extra times to make sure)

[After starting the game]:
* Used the cube and overview (switched desktop)
* Started GSR script
* Launched application dashboard
* Saved GSR clips (another script)
* Clicked the screen and random keys while I still saw the breeze cursor

I was unable to reproduce it after the reboot, I got nothing other than it's definitely still here.
It does seem to be partly fixed in some update however, as rebooting did nothing before.
Comment 26 Lars Veldscholte 2024-03-16 13:09:17 UTC
Same issue here. I didn't have this issue on Plasma 5.27 (I was already using Wayland back then).

Straight after booting, it always works fine, but after using Plasma for a while and starting up a game, the mouse doesn't work anymore. I've also noticed that sometimes it spontaneously starts working fine again after trying some things (alt-tabbing, clicking, mashing some buttons) but I've not been able to narrow it down to some specific trigger.

The issue still exists on Plasma 6.02 / Qt 6.6.2.
Comment 27 Jason Playne 2024-03-17 15:23:53 UTC
(In reply to Lars Veldscholte from comment #26)
> Same issue here. I didn't have this issue on Plasma 5.27 (I was already
> using Wayland back then).
> 
> Straight after booting, it always works fine, but after using Plasma for a
> while and starting up a game, the mouse doesn't work anymore. I've also
> noticed that sometimes it spontaneously starts working fine again after
> trying some things (alt-tabbing, clicking, mashing some buttons) but I've
> not been able to narrow it down to some specific trigger.
> 
> The issue still exists on Plasma 6.02 / Qt 6.6.2.

I can concur that a reboot does indeed allow me to play the game, i wonder if sleep/resume is the thing that breaks it?
Comment 28 Lars Veldscholte 2024-03-17 16:12:02 UTC
I'll have to double check, but I think I've also had it break without a sleep/resume.

Also, I think Bug 482629 might the same bug?
Comment 29 tylerkstrayhan 2024-03-17 17:20:53 UTC
(In reply to Jason Playne from comment #27)
> (In reply to Lars Veldscholte from comment #26)
> > Same issue here. I didn't have this issue on Plasma 5.27 (I was already
> > using Wayland back then).
> > 
> > Straight after booting, it always works fine, but after using Plasma for a
> > while and starting up a game, the mouse doesn't work anymore. I've also
> > noticed that sometimes it spontaneously starts working fine again after
> > trying some things (alt-tabbing, clicking, mashing some buttons) but I've
> > not been able to narrow it down to some specific trigger.
> > 
> > The issue still exists on Plasma 6.02 / Qt 6.6.2.
> 
> I can concur that a reboot does indeed allow me to play the game, i wonder
> if sleep/resume is the thing that breaks it?

I tested mine instantly on a boot up and it does it, so don't think its a sleep/resume issue. (In reply to Lars Veldscholte from comment #28)
> I'll have to double check, but I think I've also had it break without a
> sleep/resume.
> 
> Also, I think Bug 482629 might the same bug?

Looks like it. Seems we reported almost at the same time.
Comment 30 Konrad Materka 2024-04-04 16:45:11 UTC
OK, I'm closing this as a duplicate of Bug 482476. Please check if it is already fixed in 6.0.3 and comment there.

*** This bug has been marked as a duplicate of bug 482476 ***
Comment 31 gfunk 2024-04-04 23:06:15 UTC
Thanks I haven't seen the issue since 6.0.3