Workaround gamescope invisible cursor bug in Ubuntu 26.04
The bug
On Ubuntu 26.04 (resolute, which ships gamescope 3.16.20), launching a game
through gamescope with --force-grab-cursor can make the mouse
pointer vanish. Upstream:
https://github.com/ValveSoftware/gamescope/issues/2180
Dropping --force-grab-cursor avoids the bug, but that flag is
what confines the pointer to the game window on a multi-monitor setup, so
removing it is not an acceptable fix here.
A Workaround
Only one thing worked for me: build the older questing gamescope 3.16.15 and run it instead of resolute's 3.16.20.
Everything else raised on #2180 and related threads failed or did not apply:
--hide-cursor-delay 99999— no effect.WLR_NO_HARDWARE_CURSORS=1— no effect.- Borderless-windowed / backend switching — unreliable.
- winecfg / protontricks "capture mouse in fullscreen" — Proton/Wine only, so no help for a native-Linux game.
- Downgrade further, to 3.14.x — unnecessary; 3.16.15 sufficed.
Both 3.16.15 and 3.16.20 are 3.16.x, so the regression landed in a commit between those two tags.
Procedure for Agents
Build gamescope 3.16.15-2 from Ubuntu questing sources and
install, self-contained, under ~/Stow/gamescope-questing. No root,
no system changes. resolute dropped wlroots 0.18 (ships 0.19), which 3.16.15
needs — Debian patch 0006 wires gamescope to the system
libwlroots-0.18-dev, and the Debian tarball strips the vendored
subprojects/wlroots — so build wlroots 0.18 from its matching Ubuntu
source into the same prefix.
Sources
All from the Ubuntu archive. Confirm each download's checksum against the
Checksums-Sha256 field of its .dsc.
- gamescope
3.16.15-2,pool/multiverse/g/gamescope/
https://packages.ubuntu.com/source/questing/gamescope - wlroots
0.18.2-3(source behind questing'slibwlroots-0.18-dev),pool/universe/w/wlroots/
https://packages.ubuntu.com/questing/libwlroots-0.18-dev
Prerequisites
Install both packages' Build-Depends (see each .dsc).
gamescope's libwlroots-0.18-dev is supplied by the wlroots build
below; wlroots' libcairo2-dev is needed only for examples, which are
disabled.
Build
Prefix for both: PREFIX="$HOME/Stow/gamescope-questing". Apply
each package's Debian quilt patches before configuring:
while read p; do patch -p1 -i debian/patches/$p; done < debian/patches/series
1. wlroots 0.18.2 -> $PREFIX
meson setup build --prefix="$PREFIX" --libdir=lib --buildtype=release \
-Dexamples=false -Dwerror=false
ninja -C build install
Installs libwlroots-0.18.so, headers under
include/wlroots-0.18, and lib/pkgconfig/wlroots-0.18.pc.
2. gamescope 3.16.15 -> $PREFIX
Two source edits after patching:
src/meson.build: patch0006hardcodes/usr/include/wlroots-0.18inreshade_include. Replace withjoin_paths(get_option('prefix'), 'include', 'wlroots-0.18').src/meson.build:vcs_tag()has no git tree, so the--versionbanner is blank. Aftergamescope_version_conf = configuration_data()addgamescope_version_conf.set('VCS_TAG', '3.16.15').
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:\
/usr/lib/x86_64-linux-gnu/pkgconfig:\
/usr/lib/pkgconfig:\
/usr/share/pkgconfig"
meson setup build --prefix="$PREFIX" --libdir=lib --bindir=bin --buildtype=release \
-Dpipewire=enabled -Denable_openvr_support=false \
-Dcpp_link_args='-Wl,-rpath,$ORIGIN/../lib' \
-Dc_link_args='-Wl,-rpath,$ORIGIN/../lib'
ninja -C build install
Choices, matching the Debian rules except where noted:
-Dpipewire=enabled -Denable_openvr_support=falsefrom Debianrules.bindir=bin,libdir=lib(Debian uses/usr/games) so the tree suits a stow package.PKG_CONFIG_PATHputs$PREFIXfirst so the staged wlroots-0.18 wins.- rpath
$ORIGIN/../libletsgamescopefind its bundledlibwlroots-0.18.soboth in the raw prefix and after stowing.
Verify
readelf -d "$PREFIX/bin/gamescope" | grep RUNPATH # $ORIGIN/../lib
ldd "$PREFIX/bin/gamescope" | grep wlroots # resolves inside $PREFIX
"$PREFIX/bin/gamescope" --version # gamescope version 3.16.15
