hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.5k stars 899 forks source link

Mouse spinning in games #4015

Open jabuxas opened 11 months ago

jabuxas commented 11 months ago

Hyprland Version

Hyprland, built from branch HEAD at commit 9afdd61adeaf413afbe853dbc5fdf6853c8bde21 (props: bump ver to 0.32.3). Tag: v0.32.3 flags: (if any) debug

Bug or Regression?

Bug

Description

Mouse spins in games and camera is unusable, just moving a bit moves the camera around a whole lot. Gamescope fixes it, but I experience a lot of input lag using gamescope.

How to reproduce

I think it has got to do with having a multi-monitor setup, not really sure apart from that. Sometimes I just leave the window in another workspace and then come back and the mouse is bugged. Other times, just moving my mouse to the 2nd monitor and then coming back bugs out.

Crash reports, logs, images, videos

showing bug: https://youtu.be/KsKSGZCjw6g

vaxerski commented 11 months ago

does zis happen on sway?

jbalme commented 11 months ago

Confirming it happens for me in 0.30.0 in FFXIV.

h0tc0d3 commented 11 months ago

@vaxerski I have this error in overwatch 2, 1 monitor. As I understand, the event occurs only when some application blocks the input device (for example, mouse control software), and the mouse temporarily stops transmitting position data, i.e. the mouse is busy processing codes from the control software, and does not send data about the mouse displacement. For example, for Razer mice the device is blocked for 30ms, because any request, for example changing DPI, requires processing of the request by the mouse processor, and this does not happen immediately. Probably, if the input device does not respond for a short time, then CInputManager::simulateMouseMovement is probably triggered, and then the InputManager stops processing some of the events from the mouse. I also noticed that my cursor is very nervous and moves in place, I solved this by removing the CInputManager::simulateMouseMovement call and replacing vec() with goalv() in https://github.com/hyprwm/Hyprland/blob/main/src/managers/input/InputManager.cpp I've never had anything like this in sway.

phonetic112 commented 11 months ago

sometimes this happens to me in beamng, usually just wiggling around the window a bit fixes it

jabuxas commented 10 months ago

happens on monster hunter world as well. wiggling the window works if the game is running in windowed mode, but if it runs in windowed mode it doesn't automatically get 1920x1080 resolution even when fullscreening the window.

MightyPlaza commented 10 months ago

happens on monster hunter world as well. wiggling the window works if the game is running in windowed mode, but if it runs in windowed mode it doesn't automatically get 1920x1080 resolution even when fullscreening the window.

does fakefullscreen/nofullscreenrequest/nomaximizerequest make any differnece?

jabuxas commented 10 months ago

it doesn't seem to make any difference with fullscreening the window originally windowed, the then fullscreened window is still with black borders on some sides. (example with warframe) image

about the mouse spin, it doesn't seem to be happening anymore, but it's kinda random. i put all of the 3 options on the games, i'll try for a bit and if it doesn't happen anymore and if it's considered a fix, i'll close.

edit: nvm, still happening.

led0nk commented 9 months ago

I kind of got the same issue. I use a multi-monitor setup and randomly sometimes after i switched from a game to another browser workspace my mouse sensitivity is like 10 times as high as before.

On top of that i got the issue that i cannot 360 my cameraview in e.g. Ark SE and the camera sometimes stutters like it went upside down. Maximized-window-modus, window-modus etc. doesn't make any difference.

quadbyte commented 9 months ago

I'm affected too. It happens about 20% of the time after I launch Overwatch 2, sometimes it's easy to fix (getting in the menus doing a few mouse move and clicks). Sometimes it's super difficult to get the focus back. Have not found a proper way to fix it.

When it's happening the character is looking straight up to the ceiling and any touch of the mouse will make it spins super fast.

MoonBurst commented 8 months ago

Yeah, this issue, and poor grouping (which can be mostly fixed by hy3) are the main things keeping me off Hyprland. The spinning when I'm in games. I can't figure out exactly what causes it, nor a solid fix though. As far as I can guess, it has something to do with alt+tabbing out, and maybe multi-monitor.

jabuxas commented 8 months ago

it is multi monitor related, but it's hard to reproduce consistently, sometimes it happens on its own, sometimes i change workspaces a lot and then it happens, sometimes it doesn't happen at all.

Enovale commented 8 months ago

I get this problem as well with overwatch 2, ffxiv, and lethal company as well iirc.

It happens regardless of the window mode (windowed, fullscreen, borderless) but sometimes fixes if i change between them (At random) and resize the window a bunch in floating mode (still only randomly fixes it).

Also even if its fixed it will sometimes start happening again after a focus change, especially using a hotkey to switch to the workspace from a different workspace.

EDIT: I forgot to mention that this is NOT fixed with gamescope for me. It often works for a little while and then happens with gamescope anyway.

tchofy commented 8 months ago

I wonder if https://github.com/hyprwm/Hyprland/pull/4889 fixed this issue or changed the behavior. Is anyone on a -git build able to replicate this?

quadbyte commented 8 months ago

I'm on a -git build of hyprland that I update daily. Situation has slightly improved lately, it happens less frequently. But the bug it's still there, I got it two days ago.

Is there any log we could turn on or provide, to help pin pointing the issue ?

Enovale commented 8 months ago

I'm also on -git and get it at least once a day if I'm gaming.

quadbyte commented 7 months ago

For what it's worth, I also have the issue with KDE Plasma 6, playing OW2.

h0tc0d3 commented 7 months ago

For what it's worth, I also have the issue with KDE Plasma 6, playing OW2.

Sway does not have this problem and I use native wayland in wine 9.0 to play Overwatch 2, maybe this is a xwayland bug.

Enovale commented 7 months ago

This bug report describes the exact issue and it apparently got fixed in kwin: https://bugs.kde.org/show_bug.cgi?id=482476 It seems to possibly have been handled by this commit: https://invent.kde.org/plasma/kwin/-/commit/630ba5fab4b02c2b496553c79d4a315da9271b53

MROvaiz commented 6 months ago

Having same issue with all COD Series and NMS as of now which i have tested. Facing this for 1 year now.

vaxerski commented 6 months ago

please check with above

JonathanMathBoi commented 6 months ago

Running on the git AUR version rn, and that seems to have fixed the problem for me. Thanks.

vaxerski commented 6 months ago

@jabuxas can this be closed?

MROvaiz commented 6 months ago

It's Still spinning in NMS, I'm on latest version

[mro@nixbin:~]$ hyprctl systeminfo Hyprland, built from branch at commit 9a66514e26319e41c8661f57097a73b1c8579ccf (). Date: 2024-04-16 Tag: , commits: @COMMITS@

Here link, https://www.youtube.com/watch?v=kFkrFvZnCng

jabuxas commented 6 months ago

seems fine by me

MROvaiz commented 6 months ago

Can you or anyone check with NMS(no man's sky)

gulafaran commented 6 months ago

i cant get it to spin in NMS

MROvaiz commented 6 months ago

it still spins for me, little stable spin if i move my mouse. it follows extra long where i move. Newly recorded video https://youtu.be/zZUhFm4Vj0c

MROvaiz commented 6 months ago

Last update from me, It's working. Problem with Lutris or wine, i checked in steam as non steam game with proton 8. It's working smoothly, No issues so far 3 hours playing. Please close this.

Thank you.

Nama commented 6 months ago

I still have this issue on 0.39.1 in overwatch D: Using steam version.

Problem with Lutris or wine, i checked in steam as non steam game with proton 8.

What?

bljordan commented 2 months ago

This problem still exists on hyprland-0.42.0. I've tested running from Steam and Lutris with the same results. Gamescope may fix the problem but introduces other stability issues.

The problem does not exist in wayland Gnome for me.

Should I make a new issue or can we reopen this one?

bljordan commented 2 months ago

I've confirmed disabling the second monitor fixes this. monitor=DP-2,disable

Obviously not a great solution, but confirming it is related.

Nama commented 2 months ago

Didn't have any second monitor enabled while gaming, still occurred.

lpuv commented 2 weeks ago

Unfortunately still occurs for me.

sr-tream commented 1 week ago

Hello, have same or similar issue - resolved by disabling explicit sync for me (nvidia gpu)