Skip to content

android: GAMENATIVE_ROOT_DESKTOP switches A26, A33 and A48 off on wine's root desktop - #39

Closed
utkarshdalal wants to merge 1 commit into
gamenativefrom
root-desktop-switch-for-virtual-desktop-patches
Closed

utkarshdalal wants to merge 1 commit into
gamenativefrom
root-desktop-switch-for-virtual-desktop-patches

Conversation

@utkarshdalal

Copy link
Copy Markdown

The app is getting a second launch mode for newer Proton builds: wine explorer /desktop=root instead of /desktop=shell,WxH. There is no virtual desktop window then; each game window is a managed top-level X window, which is what upstream gamescope expects.

Three patches exist only for the virtual-desktop model, where gamescope sees one top-level window (wine's desktop) with the game nested inside it:

  • A26 (0026-A26-uniform-app-id.patch) gives every window app id 1.
  • A33 (0033-A33-blank-while-game-window-absent.patch) blanks the output while the game's window is absent, so wine's desktop is not shown at startup and exit.
  • A48 (0047-A48-bring-nested-app-window-to-front.patch) sends winhandler.exe a bring-to-front request when a nested child maps.

This PR adds one environment variable, GAMENATIVE_ROOT_DESKTOP, read once at startup. The app sets it for root-desktop sessions.

  • Unset, 0 or any other value: the three patches act as today. The only difference is one added root_desktop=0 field in A33's session-blank log line.
  • 1: A26 keeps upstream's appID (the X window id), A33 never raises either blank, and A48 never sends.

The three patch files are edited in place and regenerated at their position in the series; no files are renamed or added. The helper lives in A26 because it is the earliest of the three. android/README.md gets a short section on the variable.

Relation to #38: that PR drops the three patches for everyone. This one has the same effect for root-desktop sessions but keeps the patches for virtual-desktop sessions, which older Proton builds still use (NFS Most Wanted needs A48 there, per the comments on #38).

Two things the variable does not switch:

  • With 1, app ids are window ids, so a gamescope_control performance-stats request for app id 1 (what A26 was there for) matches no window. The app side needs another way to name the window before relying on those stats in root sessions.
  • A33's change to the blank texture's extent (output size instead of the 1080p cap, in rendervulkan.cpp) stays for both modes. The upstream overlay hack-plane also uses that texture.

Tested

  • The full series (gamescope patches, then wlroots) applies in order with git apply --check on a clean checkout of gamenative 3d10d68. I applied the old and new series to two clean trees and diffed src/: the only differences are the helper, the gated sites and the log field. The wlroots trees are identical. Diagnostics 0018 applies. Diagnostics 0023 already fails on gamenative without this change.
  • Not compiled locally (no termux prefix on the Mac). CI compiles it.
  • No device run has been made with the variable set yet. A run on the Odin 3 will be added to this description.

Observations from 2026-11-15 on an AYN Odin 3 with the current payload, all three patches active, root desktop: a normal game (top-level 1280x720, focused) took pad input with no A48 log lines and exited cleanly. In one root session A33 held its blank for the whole session because no newer commit arrived, so A33 does act under the root desktop.

…e's root desktop

The three patches exist only for wine's virtual desktop, where the game's
window is nested in one desktop window. With GAMENATIVE_ROOT_DESKTOP=1 the
guest runs on wine's root desktop instead: A26 keeps upstream's app id, A33
never blanks and A48 never sends its bring-to-front request. Unset or any
other value keeps today's behavior, so one binary serves both launch modes.
@joshuatam
joshuatam deleted the root-desktop-switch-for-virtual-desktop-patches branch November 16, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant