Run gamescope sessions on Wine's root desktop with Proton 11 or newer

Draft
UT
6d ago
+15-1

Description

What: when a game session runs under the gamescope display server and the container's Wine build is Proton 11 or newer, the game is launched with wine explorer /desktop=root,<WxH> instead of /desktop=shell,<WxH>. The game then runs on Wine's root desktop as managed top-level windows instead of inside Wine's virtual desktop. In the same case the gamescope process is started with GAMENATIVE_ROOT_DESKTOP=1 (added in applyGamescopeEnv, whose environment is the one gamescope is exec'd with). Everything else is unchanged: X11 sessions, pre-install steps (which always run on X11) and gamescope sessions on older Proton builds keep the exact same launch line and environment.

Why: gamescope is a window manager and expects each game window to be a top-level X window. Under the virtual desktop the game's window is a child of Wine's desktop window, which is what several of the port patches in GameNative/gamescope compensate for. Companion PR: the GameNative/gamescope draft that reads GAMENATIVE_ROOT_DESKTOP to switch off the patches that only serve the virtual-desktop model GameNative/gamescope#39 (https://github.com/GameNative/gamescope/pull/39). The gamescope payload shipped today ignores the variable, so this PR is safe on the current payload; GamescopePayload.VERSION and assets are unchanged.

Why the Proton gate: without the virtual desktop, Wine needs winex11 built with libXi. The older builds (proton-9.0-arm64ec, proton-10.0-arm64ec-2) lack it and spin on a black screen, so they keep the virtual desktop. The check is a small WineInfo.isProton11OrNewer() that reads the major version from the already-parsed WineInfo; names that fail to parse fall back to the bundled Wine and keep the virtual desktop.

Tested on an AYN Odin 3 on 2026-11-15 with a build of master c6d9a86c9 plus the unconditional form of this launch change, gamescope payload 20261105.4 (all patches active):

  • Blazing Chrome, proton-11.0-2-arm64ec-1: the game window is a 1280x720 top-level with input focus; no "bring nested window to front" action by gamescope; pad START and stick work with no screen tap; full-screen 60 fps; the game's own Exit ended the session in 7 s.
  • OMORI (needs the Steam client option on): reaches its title full-screen; pad moves the menu with no tap; game Exit ends the session in about 13 s. With the shipped Vulkan shim the picture flashes black (116 of 719 recorded frames show the game) because Wine presents OMORI's child-window swapchain offscreen; with a test build of the gamenative-drm shim that applies upstream gamescope's Xwayland-bypass rule, on proton-11.0-2-arm64ec-10, 605 of 605 frames show the game. That shim change is not part of this PR, and that comparison changed the shim and the Proton build together.
  • Not tested: gameplay beyond title/menus, other games, Mali devices, this exact commit (the Proton gate and the environment variable are new in this PR and have not run on a device yet). Not compiled locally; CI compiles it.

Recording

No recording attached.

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Runs gamescope game sessions on Wine's root desktop with Proton 11 or newer, so game windows become top-level X windows that gamescope can manage directly instead of children of Wine's virtual desktop.

  • Proton 11+ games launch with wine explorer /desktop=root,<WxH>; older builds keep /desktop=shell,<WxH> because their winex11 lacks libXi and would hang on a black screen.
  • Sets GAMENATIVE_ROOT_DESKTOP=1 in the gamescope environment so the companion GameNative/gamescope payload can disable virtual-desktop-only patches; the shipped payload ignores this variable, so behavior is unchanged there.
  • Wine builds that fail to parse as Proton fall back to the virtual desktop.