gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

--force-grab-cursor confines cursor to an area that doesn't correspond with on-screen image

Open WhyNotHugo opened this issue 8 months ago • 1 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

I'm playing StarCraft II, which only supports 16:9 on a 21:9 monitor

I run it with:

gamescope --force-grab-cursor -W 3440 -H 1440 -w 2560 -h 1440 -- …

The game itself renders on the left of the screen, with a large black space on the right (that's fine, I prefer a black space instead of a stretched game).

However, when using the --force-grab-cursor, the mouse cursor is confined to an area in the centre of my screen. As a result, I can't reach the left of the screen (but can reach half of the black area on the right).

If I remove --force-grab-cursor, I can reach any part of the screen, but then I can't trigger in-game functionality which requires putting the cursor on the right of the screen (because the cursor moves out into the black area).

Steps To Reproduce

  1. gamescope --force-grab-cursor -W 3440 -H 1440 -w 2560 -h 1440 -- flatpak run net.lutris.Lutris
  2. I'm reproducing this with StarCraft II. I don't know if this happens with other games.
  3. Move the mouse around to determine the area to which it is confined.

If you don't have a 21:9 monitor, I guess you can reproduce this with something like (untested):

gamescope --force-grab-cursor -W 3440 -H 1440 -w 1800 -h 1440 -- …

Hardware information

> cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.22.0_alpha20250108
PRETTY_NAME="Alpine Linux edge"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
> lspci -nn | grep VGA
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M] [1002:744c] (rev cc)
> vulkaninfo --summary | grep driverInfo
	driverInfo         = Mesa 24.3.4

See this gist for CPU info (it's over 600 lines and likely not relevant).

Software information

- Desktop environment: sway version 1.10.1
- Session type: wayland
- Gamescope version: gamescope 3.16.1
- Gamescope launch command(s): see above

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

Start-up logs:

> gamescope --force-grab-cursor -W 3440 -H 1440 -w 2560 -h 1440 -- flatpak run net.lutris.Lutris
[gamescope] [Info]  console: gamescope version  (gcc 14.2.0)
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/common'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/inspect.lua' (id: 0)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/modegen.lua' (id: 1)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/util.lua' (id: 2)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/displays'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/asus.rogally.lcd.lua' (id: 3)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/deckhd.steamdeck.deckhd-lcd.lua' (id: 4)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.lcd.lua' (id: 5)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 6)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/etc/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/etc/gamescope/scripts' does not exist
[gamescope] [Info]  scriptmgr: Loading scripts from: '/home/hugo/.config/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/home/hugo/.config/gamescope/scripts' does not exist
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info]  vulkan: selecting physical device 'AMD Radeon RX 7900 XT (RADV NAVI31)': queue family 1 (general queue family 0)
[gamescope] [Info]  vulkan: physical device supports DRM format modifiers
[gamescope] [Info]  wlserver: [backend/headless/backend.c:67] Creating headless backend
[gamescope] [Info]  xdg_backend: Seat name: seat0
[gamescope] [Info]  vulkan: supported DRM formats for sampling usage:
[gamescope] [Info]  vulkan:   AR24 (0x34325241)
[gamescope] [Info]  vulkan:   XR24 (0x34325258)
[gamescope] [Info]  vulkan:   AB24 (0x34324241)
[gamescope] [Info]  vulkan:   XB24 (0x34324258)
[gamescope] [Info]  vulkan:   RG16 (0x36314752)
[gamescope] [Info]  vulkan:   NV12 (0x3231564E)
[gamescope] [Info]  vulkan:   AB4H (0x48344241)
[gamescope] [Info]  vulkan:   XB4H (0x48344258)
[gamescope] [Info]  vulkan:   AB48 (0x38344241)
[gamescope] [Info]  vulkan:   XB48 (0x38344258)
[gamescope] [Info]  vulkan:   AB30 (0x30334241)
[gamescope] [Info]  vulkan:   XB30 (0x30334258)
[gamescope] [Info]  vulkan:   AR30 (0x30335241)
[gamescope] [Info]  vulkan:   XR30 (0x30335258)
[gamescope] [Info]  wlserver: Using explicit sync when available
[gamescope] [Info]  wlserver: Running compositor on wayland display 'gamescope-0'
[gamescope] [Info]  wlserver: [backend/headless/backend.c:17] Starting headless backend
[gamescope] [Info]  wlserver: Successfully initialized libei for input emulation!
[gamescope] [Info]  wlserver: [xwayland/server.c:107] Starting Xwayland on :1
[gamescope] [Info]  pipewire: stream state changed: connecting
[gamescope] [Info]  pipewire: stream state changed: paused
[gamescope] [Info]  pipewire: stream available on node ID: 95
[gamescope] [Info]  xwm: Embedded, no cursor set. Using left_ptr by default.
[gamescope] [Info]  vblank: Using timerfd.
[gamescope] [Info]  edid: Patching res 800x1280 -> 2560x1440
…

WhyNotHugo avatar Feb 15 '25 21:02 WhyNotHugo