gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

--force-grab-cursor not grabbing cursor

Open yasen-pavlov opened this issue 1 year ago • 11 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Are you using any gamescope patches or a forked version of gamescope?

  • [x] The issue occurs on upstream gamescope without any modifications

Current Behavior

On the most recent commit of master (328f06b0b5e4492cf26c7b2a6e3fe628718caddd), when I start gamescope with --froce-grab-cursor the mouse is not grabbed as expected , it was last working for me on 328f06b0b5e4492cf26c7b2a6e3fe628718caddd (the commit before the latest batch of commits from 2 days ago).

Steps To Reproduce

  1. Start gamescope with gamescope --force-grab-cursor --
  2. Move the mouse around in a windowed application (also having the same issue when it's full screen)
  3. The cursor is able to leave the window

Hardware information

- Distro: Arch
- CPU: Intel Core i9 - 9900K
- GPU: NVIDIA GeForce RTX 2080 Ti 
- Driver Version: 565.77

Software information

- Desktop environment: Hyprland(0.46.0f commit 56153a9c1b0a00fac0932a95e0cfa5a4f6c681f)
- Session type: wayland
- Gamescope version: 3.16.1-34-g328f06b
- Gamescope launch command(s): `--force-grab-cursor`

Which gamescope backends have the issue you are reporting?

  • [x] Wayland (default for nested gamescope)
  • [ ] DRM (default for embedded gamescope, i.e. gamescope-session)
  • [ ] SDL
  • [ ] OpenVR

Logging, screenshots, or anything else

Video showing the issue on the current commit:

https://github.com/user-attachments/assets/2d060262-130c-447b-9dbc-53c49600419c

And a video without the issue on the latest good commit:

https://github.com/user-attachments/assets/b3c8479c-e070-45c4-b94e-0a2cc2f089e8

yasen-pavlov avatar Jan 19 '25 00:01 yasen-pavlov

this issue is partially fixed with https://github.com/ValveSoftware/gamescope/commit/19dc18e81a0b4ea5fc340b225150ac4b8ee729fc but --force-grab-cursor seems to lose its lock on to the main window after alt-tabbing or not establish one properly in the first place.

gamescope -e --force-grab-cursor -- steam -steamdeck -steamos3 on Fedora 41 KDE Wayland w/ Mesa 24.3.3, NVK AD102

https://github.com/user-attachments/assets/24efc859-86ce-4e3c-bab2-d4cb11f8e400

EDIT: also happens on Arch w/ a 7900XTX

matte-schwartz avatar Jan 22 '25 04:01 matte-schwartz

Great, 19dc18e81a0b4ea5fc340b225150ac4b8ee729fc fixes it for me on hyprland also when changing the the focus to another window and then back, though hyprland doesn't really have a notion for alt tabbing:

https://github.com/user-attachments/assets/c0231e95-39d0-4c2b-8091-273197f3263a

I don't have KDE installed on this machine, but I can install it a bit later to check if I can reproduce the same issue.

edit: just installed KDE and gave it a shot and the fix is working for me when I tried to run a few games

https://github.com/user-attachments/assets/f5fe19e5-2a35-465d-990f-60afe445e6a0

edit2: gah nevermind I just tried starting steam in big picture mode and I see the same behavior as @matte-schwartz

https://github.com/user-attachments/assets/088161f1-662b-4da2-ae53-4ac4d65146f6

I also tried running a few other games and the fix worked as expected with all of them, I could only reproduce this with steam.

yasen-pavlov avatar Jan 22 '25 19:01 yasen-pavlov

@yasen-pavlov appreciate the extra testing, seems like the main thing that regressed is using -e in gamescope w/ embedded Steam

matte-schwartz avatar Jan 23 '25 00:01 matte-schwartz

Similar thing on Niri, --backend sdl seems to fix it

bandithedoge avatar Feb 07 '25 18:02 bandithedoge

also facing this issue on gnome 48 in arch using these commands gamescope -w 1920 -h 1440 -r 240.0 -S stretch -f --adaptive-sync --force-grab-cursor --immediate-flips -- %command% gamescope 3.16.2-1 mesa 1:25.0.3-1

ZeesBa avatar Apr 04 '25 14:04 ZeesBa

Same issue here on NixOS but only for the latest version (3.16.3). I downgraded to 3.16.2 (nixpkgs rev 8fcb6f1c4948305af52d19f887b89011ee2c080d) and cursor lock works again.

tsawhill avatar Apr 04 '25 20:04 tsawhill

Same issue here. I also saw this in gamescope-git in the weeks prior to todays update from 3.16.2 -> 3.16.3

"--backend sdl" temporarily fixes but causes it's own issues on moving away and back to the gamescope 'window'.

Rolling back to 3.16.2 makes force-grab-cursor work as I expect again.

boomboxnation avatar Apr 06 '25 16:04 boomboxnation

Same issue here. I also saw this in gamescope-git in the weeks prior to todays update from 3.16.2 -> 3.16.3

"--backend sdl" temporarily fixes but causes it's own issues on moving away and back to the gamescope 'window'.

Rolling back to 3.16.2 makes force-grab-cursor work as I expect again.

Can confirm downgrading back to 3.16.2 fixes things.

kurimanju-dev avatar Apr 08 '25 17:04 kurimanju-dev

does not work for me as soon as i use --mangoapp :(

DSDV avatar Jul 25 '25 19:07 DSDV

Same issue here, makes it very inconvenient to play FPS games at non-native resolutions. I basically have to turn off my other outputs in order to make sure the cursor doesn't leave to another screen. WM: River (tested on hyprland and sway as well) GPU: AMD 9060XT Mesa 25.1.6-1 Linux 16.15.7

imavlr avatar Jul 27 '25 21:07 imavlr

I am still seeing this issue with gamescope 3.16.17

westongpt avatar Dec 27 '25 21:12 westongpt