Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Mouse focus issues with multimonitor + gamescope

Open RadicalityIncident opened this issue 1 year ago • 10 comments

Hyprland Version

System/Version info
Hyprland, built from branch HEAD at commit 84ab8d11e8951a6551d1e1bf87796a8589da6d47  (props: bump ver to 0.35.0).
Date: Mon Feb 5 01:59:02 2024
Tag: v0.35.0

flags: (if any)


System Information:
System name: Linux
Node name: Anaconda
Release: 6.7.5-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Sat, 17 Feb 2024 14:02:33 +0000


GPU information:
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900M] [1002:744c] (rev c8) (prog-if 00 [VGA controller])
15:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raphael [1002:164e] (rev cb) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Bug or Regression?

Bug

Description

I'm experiencing a kind of odd hard to pin down issue with mouse focusing in games using gamescope. The behavior is new and this exact configuration used to work fine so I'm not exactly sure what happened.

Basically I launch most games from steam using gamescope with a gamescope -W 3440 -H 1440 -r 95 -- %command% flag in steam options, then fullscreen the game on launch with my hyprland fullscreen keybind (Gamescopes fullscreen keybind or -f flag gives me weird resolution issues but thats always been the case and using Hyprlands fullscreen has previously worked fine so I never worried about it).

At first everything seems normal and I can move the mouse around as much as I want and it will remain focused on the game window. However when I start clicking eventually it seems that the mouse focuses a window on another monitor and input stops going to the game. The cursor remains invisible and my waybar which shows the active window still claims the game window is active however if I do something like activate a fullscreen keybind or a float keybind it will apply to a window other than the game.

If there are no windows open on my other monitors the game will behave normally and input will always go to the game window.

This is hard to describe exactly so a video is attached showing the behavior

A quick edit to add: Launching games the same way in an X11 wm (i3) does not exhibit any similar behavior and works as expected. I don't have any other window managers installed other than Hyprland and i3 so that was the extent of what I tested.

How to reproduce

Run a game from steam using gamescope while having open windows on additional monitors. Eventually when clicking the behavior will occur

Crash reports, logs, images, videos

https://github.com/hyprwm/Hyprland/assets/43446766/3b600970-1af0-46fa-afb3-a459724a8b66

RadicalityIncident avatar Feb 18 '24 18:02 RadicalityIncident

This seems to be an issue with gamescope from 3.13.x and up I've been using gamescope 3.12 as a work around. Using downgrade you can easily switch versions.

clanps avatar Feb 19 '24 17:02 clanps

I have been experiencing the exact same bug running a fullscreen game (DDNet) without gamescope. Downgrading hyprland to 0.34 made the bug disappear, so i don't think this is just a gamescope issue.

johannesHHM avatar Feb 19 '24 18:02 johannesHHM

I'm not able to reproduce the issue on DDNet. and I'm on 0.35. I think your issue might be a one off and unrelated to the gamescope issue. Also I'd like to add the gamescope issue has existed for a few months now and isn't specific to 0.35

clanps avatar Feb 19 '24 19:02 clanps

Hm, rather than downgrade my system packages I built gamescope 3.12.7 and 3.12.0 myself and tried running with those versions and the behavior remained the same unfortunately.

RadicalityIncident avatar Feb 19 '24 23:02 RadicalityIncident

did you also try with the flag --force-grab-cursor ?

clanps avatar Feb 20 '24 01:02 clanps

do you have resize_on_border set to true in the config?

zakk4223 avatar Feb 20 '24 05:02 zakk4223

Just had an opportunity to test with --force-grab-cursor and unfortunately no change in the behavior. Also I do not have resize_on_border in my config file and the hyprland wiki says it is set to false by default.

RadicalityIncident avatar Feb 21 '24 22:02 RadicalityIncident

It may very well be a hyprland issue but I'm not able to reproduce it myself at least on the games I tried being Roblox and Dead By Daylight

clanps avatar Feb 21 '24 22:02 clanps

I ran into the exact same issue yesterday with quakespasm. Haven't run any other games before on hyprland, so I thought I would just need to conf it correctly, so haven't looked into it yet further. System config for me is also pretty much the same.

System/Version info
Hyprland, built from branch HEAD at commit 84ab8d11e8951a6551d1e1bf87796a8589da6d47  (props: bump ver to 0.35.0).
Date: Mon Feb 5 01:59:02 2024
Tag: v0.35.0

flags: (if any)


System Information:
System name: Linux
Node name: albaqarah
Release: 6.7.5-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Sat, 17 Feb 2024 14:02:33 +0000


GPU information: 
c3:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev c5) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

cluosh avatar Feb 22 '24 13:02 cluosh

#4650 ?

Also, commenting "me too" doesn't help. Please just add a :+1: to the issue instead.

vaxerski avatar Feb 22 '24 15:02 vaxerski

More for other to reference, I am getting the same issue. I tried implementing several gamescope launch options, and none of them worked. The only thing that worked for me was to downgrade to 0.34. Hopefully it can get fixed soon, but I know Vaxerski is really busy with more pressing issues.

(sorry for the "me too" comment, just want to post the work around that helped me)

jtkellys avatar Feb 23 '24 21:02 jtkellys

I was getting annoyed with the mouse constantly switching to another window on my other monitor while playing a game in gamescope (probably not limited to this as seen in another issue).

I tested to see if it would happen when the window was floating and not fullscreen, this didn't fix the problem but made me realise what could. When the cursor switched to the other monitor I saw it using the resize cursor, which then lead me to turn off resize_on_border. This fixed the issue of all the keyboard inputs being output into a window on another monitor while the mouse stayed inside gamescope. The resize_on_border had already been mentioned but said to not work but it has done for me.

Even with resize_on_border disabled I'm able to shove the mouse onto the other workspace, but it will not focus the windows of that workspace like it did when it was enabled.

Here is a video showing what I mean. Also gamescope is running in 3840x1800 so there is black bars, its not the void between the monitors. Video: https://youtu.be/wXFJMH5ywLQ Unable to directly upload it even after converting to 1080p and changing the bitrate

Hope this provides more information and isn't just a wall of text that that adds nothing to this issue. If so please mention how to properly go about getting the information needed to help progress this issue.

Kagukara avatar Feb 27 '24 23:02 Kagukara

Haven't had a chance to do much testing on this recently but I just updated to v0.36.0-78-g024d4ddc and I believe the issue has been fixed! Tested with Cyberpunk in gamescope and Palworld and both work as expected now.

(Note: If like me you experience a different issue where mouselook stops your camera from moving more than roughly 90 degrees in either direction, that is a gamescope bug in the current version in the arch repos. Switching to the AUR gamescope-git resolved it for me)

RadicalityIncident avatar Mar 09 '24 00:03 RadicalityIncident