fix(linux): a Steam launch on the Deck's desktop asks for an X11 window, so Steam follows the focus #2803

Merged
HumanBean merged 1 commit from omgitsgela/Longshot:fix/deck-x11-under-steam into main 2026-11-29 17:21:04 +00:00
Member

Summary

Started by Steam in Desktop Mode on a Steam Deck, the game got Steam's Desktop layout for the controller instead of
the game's, so a face button opened the in-game menu and the left trigger sent Escape. Nothing was wrong with the pad or
the mapping: the game ran as a native Wayland window, and Steam is an X11 client that does not follow the focus of a
Wayland window. It therefore never saw the game as the foreground application and kept the desktop layout bound, at
logs/controller.txt: Queueing activation for controller: 15 app: 413080 (Steam's desktop app), while the game's own
app id was only warmed.

This asks for an X11 window first when Steam started the process on a Steam Deck's desktop session, and keeps Wayland
first otherwise, for its mailbox present. With an X11 window Steam activates the game's own app id within a second and
the pad behaves as it does in Game Mode.

The choice is one pure function, hos_sdl_video_order in host/hos_video_order.h, asked by
host/posix/display_sdl.c where it used to hard-code "wayland,x11". It takes three inputs: the process was started by
Steam (SteamGameId, SteamAppId or STEAM_COMPAT_CLIENT_INSTALL_PATH), gamescope is not the compositor, and the
machine is a Steam Deck (Jupiter or Galileo from /sys/devices/virtual/dmi/id/product_name). Under gamescope
(Game Mode) it returns nothing and SDL keeps its own order, so Game Mode is untouched.

Why the Deck only. The fault is Steam's, not the Deck's: any native Wayland game started from Steam on a Wayland
desktop gets the desktop layout. Preferring X11 everywhere is also the riskier change, because the renderer picks
mailbox when the Vulkan surface has one and stays FIFO otherwise (gpu/vk/vk_main.cpp, V-Sync Auto), so a desktop whose
X11 surface lacks mailbox can lose vblank for the whole session. That cost is measured only on the hardware in Testing,
so the rule stops there; the other desktops keep Wayland, and widening it needs the matched frame-time comparison the
review asked for. A session with no XWayland at all still falls back to Wayland inside SDL, keeping Steam's desktop
layout, which is Steam's own bug in that configuration.

A variable Steam sets counts only when it holds a value: one exported and left empty is a wrapper's placeholder, not a
launch, and does not switch a Deck's desktop to X11.

The hint is only the order SDL picks from: it is skipped entirely when SDL_VIDEODRIVER or SDL_VIDEO_DRIVER is already
set (a player or a launcher can do that), and SDL chooses the first driver that initializes, so the X11 entry is a
preference that Wayland still answers when X11 cannot open a display.

To see the bug on main: start the game from a Steam shortcut in Desktop Mode on a Deck, then press a face button. It
opens the in-game menu instead of acting, and Steam's logs/controller.txt shows the controller activated for app
413080.

Testing

Tested: Steam Deck LCD (VANGOGH, RADV, SteamOS 7.2.7-valve2-neptune), Desktop Mode with Steam running, started from a
Steam shortcut. Before: a face button opened the Longshot menu, the left trigger sent Escape, xdotool saw no X11
window, and Steam's log showed the desktop app 413080 bound. After: the window is X11, Steam's log shows
Queueing activation for controller: 15 app: -1211248510 (the game's own shortcut id), and the pad drives the menus
and the game normally. The same build in Game Mode is unchanged and correct, and with Steam closed the game still starts
a Wayland window and the pad works as before.

The rule itself is covered game-free: tests/test_video_order.py compiles hos_sdl_video_order and checks all three
inputs for the Deck's two models, a machine that must keep Wayland, and the gamescope case.

Frame pacing on the Deck, X11 against Wayland, matched: the same build, the same settings (V-Sync Auto), the same
window size (swapchain 1152x718), the title scene, present-to-present times from RX_VK_FRAME_TRACE, both log
vk: swapchain 1152x718, 4 images, mailbox (V-Sync Auto). Frames 600 to 9600 of each run:

mean p50 p95 p99 1% low worst over 16.7 ms
X11 (this branch) 7.17 ms, 139.4 fps 6.23 14.03 22.68 28.86 72.0 2.78%
Wayland (same build, forced) 7.19 ms, 139.1 fps 6.27 14.03 22.62 28.85 67.2 2.74%

Whole runs, startup hitches included: 7.06 ms against 6.95 ms mean, 1% low 30.03 against 30.16, worst 311 against
318 ms. The X11 swapchain on this Deck gets mailbox from RADV, so the concern that leaving Wayland would cost the Deck
its mailbox does not hold here.

No XWayland: with DISPLAY unset so no X11 display can be opened, the same launch (Steam's variables set, the Deck)
starts anyway: Wayland window, 6121 frames presented, mailbox, no X11 window at all, exit code 0.

On the Deck LCD the rule was exercised both ways: with Steam's launch variables set the game opens an X11 window
(xdotool finds Longshot, its pid the game's); with the same variables exported but empty there is no X11 window at
all, so it runs on Wayland.

Suite on this machine: tests/run_all.py --strict (Linux, CXX=g++) reports the same 211 failures on main and on
this branch, every one of them a test that needs a tool this machine does not have (clang, clang++); this branch
adds none. mise run test itself cannot run here: its pinned ruff and pre-commit need uv >= 0.12.10 and this
machine has 0.11.26. CI has both.

Still to test: an OLED Deck (DMI Galileo, the same name list) by hand: a contributor with that hardware.

Measurements

Verdict: the bug reproduces on main and is gone here on the hardware measured: Steam's own log moves from its
desktop app to the game's app id, and the game-free check pins the rule and its limits.

Setup: Steam Deck LCD, RADV, SteamOS 7.2.7-valve2; Desktop Mode; Steam's logs/controller.txt, xdotool for the
window kind, and tests/test_video_order.py, which compiles hos_sdl_video_order and checks the cases.

Before: main @ 01d6878b After: this PR @ 0e374933
tests/test_video_order.py fails: hos_video_order.h does not exist passes: X11 first only for a Steam start on a Deck's desktop, Wayland for other machines
Steam's controller binding, Deck Desktop Mode app: 413080 (Steam's desktop app) app: -1211248510 (the game's own id)
A face button in Deck Desktop Mode opens the in-game menu (a desktop key) acts in the game
A Steam launch on any other machine Wayland first Wayland first (unchanged)
Steam's launch variables exported but empty, on the Deck X11 first (any non-NULL value counted) Wayland first: an empty value is a placeholder
Window on the Deck with the launch variables set Wayland, Steam keeps its desktop layout X11, Steam activates the game's own id

Risks

On a Steam Deck's desktop session under Steam the window is presented through X11 instead of Wayland, and the reason
Wayland was preferred is its mailbox present, which X11 surfaces do not all have. Frame pacing on that path is not
measured
: the change was verified for input, and it is now confined to the one platform where at least that much is
known. Every other machine keeps the old order, so their presentation is untouched. Reverting is one line and Game Mode
is not affected. Nothing else changes: no options keys, no saves, nothing on screen.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Started by Steam in Desktop Mode on a Steam Deck, the game got Steam's **Desktop** layout for the controller instead of the game's, so a face button opened the in-game menu and the left trigger sent Escape. Nothing was wrong with the pad or the mapping: the game ran as a native Wayland window, and Steam is an X11 client that does not follow the focus of a Wayland window. It therefore never saw the game as the foreground application and kept the desktop layout bound, at `logs/controller.txt`: `Queueing activation for controller: 15 app: 413080` (Steam's desktop app), while the game's own app id was only warmed. This asks for an X11 window first when Steam started the process on a Steam Deck's desktop session, and keeps Wayland first otherwise, for its mailbox present. With an X11 window Steam activates the game's own app id within a second and the pad behaves as it does in Game Mode. The choice is one pure function, `hos_sdl_video_order` in `host/hos_video_order.h`, asked by `host/posix/display_sdl.c` where it used to hard-code `"wayland,x11"`. It takes three inputs: the process was started by Steam (`SteamGameId`, `SteamAppId` or `STEAM_COMPAT_CLIENT_INSTALL_PATH`), gamescope is not the compositor, and the machine is a Steam Deck (`Jupiter` or `Galileo` from `/sys/devices/virtual/dmi/id/product_name`). Under gamescope (Game Mode) it returns nothing and SDL keeps its own order, so Game Mode is untouched. **Why the Deck only.** The fault is Steam's, not the Deck's: any native Wayland game started from Steam on a Wayland desktop gets the desktop layout. Preferring X11 everywhere is also the riskier change, because the renderer picks mailbox when the Vulkan surface has one and stays FIFO otherwise (`gpu/vk/vk_main.cpp`, V-Sync Auto), so a desktop whose X11 surface lacks mailbox can lose vblank for the whole session. That cost is measured only on the hardware in Testing, so the rule stops there; the other desktops keep Wayland, and widening it needs the matched frame-time comparison the review asked for. A session with no XWayland at all still falls back to Wayland inside SDL, keeping Steam's desktop layout, which is Steam's own bug in that configuration. A variable Steam sets counts only when it holds a value: one exported and left empty is a wrapper's placeholder, not a launch, and does not switch a Deck's desktop to X11. The hint is only the order SDL picks from: it is skipped entirely when `SDL_VIDEODRIVER` or `SDL_VIDEO_DRIVER` is already set (a player or a launcher can do that), and SDL chooses the first driver that initializes, so the X11 entry is a preference that Wayland still answers when X11 cannot open a display. To see the bug on `main`: start the game from a Steam shortcut in Desktop Mode on a Deck, then press a face button. It opens the in-game menu instead of acting, and Steam's `logs/controller.txt` shows the controller activated for app `413080`. ## Testing **Tested:** Steam Deck LCD (VANGOGH, RADV, SteamOS 7.2.7-valve2-neptune), Desktop Mode with Steam running, started from a Steam shortcut. Before: a face button opened the Longshot menu, the left trigger sent Escape, `xdotool` saw no X11 window, and Steam's log showed the desktop app `413080` bound. After: the window is X11, Steam's log shows `Queueing activation for controller: 15 app: -1211248510` (the game's own shortcut id), and the pad drives the menus and the game normally. The same build in Game Mode is unchanged and correct, and with Steam closed the game still starts a Wayland window and the pad works as before. The rule itself is covered game-free: `tests/test_video_order.py` compiles `hos_sdl_video_order` and checks all three inputs for the Deck's two models, a machine that must keep Wayland, and the gamescope case. **Frame pacing on the Deck, X11 against Wayland, matched:** the same build, the same settings (V-Sync Auto), the same window size (swapchain 1152x718), the title scene, present-to-present times from `RX_VK_FRAME_TRACE`, both log `vk: swapchain 1152x718, 4 images, mailbox (V-Sync Auto)`. Frames 600 to 9600 of each run: | | mean | p50 | p95 | p99 | 1% low | worst | over 16.7 ms | |---|---|---|---|---|---|---|---| | X11 (this branch) | 7.17 ms, 139.4 fps | 6.23 | 14.03 | 22.68 | 28.86 | 72.0 | 2.78% | | Wayland (same build, forced) | 7.19 ms, 139.1 fps | 6.27 | 14.03 | 22.62 | 28.85 | 67.2 | 2.74% | Whole runs, startup hitches included: 7.06 ms against 6.95 ms mean, 1% low 30.03 against 30.16, worst 311 against 318 ms. The X11 swapchain on this Deck gets mailbox from RADV, so the concern that leaving Wayland would cost the Deck its mailbox does not hold here. **No XWayland:** with `DISPLAY` unset so no X11 display can be opened, the same launch (Steam's variables set, the Deck) starts anyway: Wayland window, 6121 frames presented, mailbox, no X11 window at all, exit code 0. On the Deck LCD the rule was exercised both ways: with Steam's launch variables set the game opens an X11 window (`xdotool` finds `Longshot`, its pid the game's); with the same variables exported but empty there is no X11 window at all, so it runs on Wayland. **Suite on this machine:** `tests/run_all.py --strict` (Linux, `CXX=g++`) reports the same 211 failures on `main` and on this branch, every one of them a test that needs a tool this machine does not have (`clang`, `clang++`); this branch adds none. `mise run test` itself cannot run here: its pinned `ruff` and `pre-commit` need `uv` >= 0.12.10 and this machine has 0.11.26. CI has both. **Still to test:** an OLED Deck (DMI `Galileo`, the same name list) by hand: a contributor with that hardware. ## Measurements **Verdict:** the bug reproduces on `main` and is gone here on the hardware measured: Steam's own log moves from its desktop app to the game's app id, and the game-free check pins the rule and its limits. Setup: Steam Deck LCD, RADV, SteamOS 7.2.7-valve2; Desktop Mode; Steam's `logs/controller.txt`, `xdotool` for the window kind, and `tests/test_video_order.py`, which compiles `hos_sdl_video_order` and checks the cases. | | Before: main @ 01d6878b | After: this PR @ 0e374933 | |---|---|---| | `tests/test_video_order.py` | fails: `hos_video_order.h` does not exist | passes: X11 first only for a Steam start on a Deck's desktop, Wayland for other machines | | Steam's controller binding, Deck Desktop Mode | `app: 413080` (Steam's desktop app) | `app: -1211248510` (the game's own id) | | A face button in Deck Desktop Mode | opens the in-game menu (a desktop key) | acts in the game | | A Steam launch on any other machine | Wayland first | Wayland first (unchanged) | | Steam's launch variables exported but empty, on the Deck | X11 first (any non-NULL value counted) | Wayland first: an empty value is a placeholder | | Window on the Deck with the launch variables set | Wayland, Steam keeps its desktop layout | X11, Steam activates the game's own id | ## Risks On a Steam Deck's desktop session under Steam the window is presented through X11 instead of Wayland, and the reason Wayland was preferred is its mailbox present, which X11 surfaces do not all have. **Frame pacing on that path is not measured**: the change was verified for input, and it is now confined to the one platform where at least that much is known. Every other machine keeps the old order, so their presentation is untouched. Reverting is one line and Game Mode is not affected. Nothing else changes: no options keys, no saves, nothing on screen. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
fix(linux): a Steam launch on a Wayland desktop asks for an X11 window, so Steam follows the focus
Some checks failed
PR description / Title and description (pull_request_target) Successful in 15s
CI / What the change needs (pull_request) Successful in 21s
CI / Third-party parts and guide screenshots (pull_request) Failing after 24s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 24s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m11s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m18s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m47s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m50s
CI / Website build and checks (pull_request) Failing after 1m23s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 21m14s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 31m50s
f2f1637b5f
Started by Steam in Desktop Mode, the game got Steam's Desktop layout for the
controller instead of the game's, so a face button opened the in-game menu and
the left trigger sent Escape. The game ran as a native Wayland window; Steam is
an X11 client and does not follow the focus of one, so it never saw the game as
the foreground application and kept the desktop layout bound
(logs/controller.txt: "Queueing activation for controller: 15 app: 413080",
Steam's desktop app, while the game's own app id was only warmed).

With an X11 window Steam activates the game's own app id within a second and the
pad behaves as it does in Game Mode. The order is one pure function,
hos_sdl_video_order, so the cases stay checkable: X11 first only when Steam
started the process and gamescope is not the compositor, Wayland first otherwise
for its mailbox present, and SDL's own order under gamescope.

tests/test_video_order.py compiles the function and checks the three cases.

Co-authored-by: Hermes Agent <hermes@localhost>
Author
Member

Tested in game: Steam Deck LCD (VANGOGH, RADV), SteamOS 7.2.7-valve2-neptune, Desktop Mode with Steam running, started from a Steam shortcut. Before: a face button opened the Longshot menu and L2 sent Escape, and Steam's log bound the controller to app 413080 (its desktop app). After: the window is X11, Steam's log shows the controller activated for the game's own app id within a second, and the pad drives the menus and the game normally. The same build in Game Mode is unchanged and correct.

Tested in game: Steam Deck LCD (VANGOGH, RADV), SteamOS 7.2.7-valve2-neptune, Desktop Mode with Steam running, started from a Steam shortcut. Before: a face button opened the Longshot menu and L2 sent Escape, and Steam's log bound the controller to app 413080 (its desktop app). After: the window is X11, Steam's log shows the controller activated for the game's own app id within a second, and the pad drives the menus and the game normally. The same build in Game Mode is unchanged and correct.
Author
Member

@review — ready. The whole change is one rule, hos_sdl_video_order in host/hos_video_order.h, asked where display_sdl.c used to hard-code the order; Game Mode takes no new path. Frame pacing on the X11 path in Desktop Mode is not measured, and the description says so. Related: #2802, found on the same build.

@review — ready. The whole change is one rule, `hos_sdl_video_order` in `host/hos_video_order.h`, asked where `display_sdl.c` used to hard-code the order; Game Mode takes no new path. Frame pacing on the X11 path in Desktop Mode is not measured, and the description says so. Related: #2802, found on the same build.
BeanBot left a comment

Recommendation: Request changes. The Deck test shows that the controller fix works there. The presentation cost on affected desktop systems also needs measurement before merge.

Steam desktop launches prefer an X11 window so Steam can apply the game's controller layout; other launches retain their existing order. This fixes the reported input problem on the tested Deck, at the cost of changing the presentation path for Steam desktop launches.

Blocking (1): must change before merging.

  1. L3: The check CI / Third-party parts and guide screenshots (pull_request) fails on this head and passes on the base branch: Failing after 24s.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L1 host/posix/display_sdl.c:354: The X11 presentation path's frame pacing and behavior on other affected Linux GPU drivers have not been measured. (more on the line) Do: Compare main and this head on affected NVIDIA and AMD Linux desktops, using the same scene and settings for multiple interleaved runs; report frame times, 1% lows and present behavior. (@fix does its part first: Preserve Wayland where Steam can follow its focus, if such a detectable configuration is available.)
  • L2 host/posix/display_sdl.c:354: The stated fallback when XWayland is unavailable has not been tested. (more on the line) Do: Run a Steam launch without XWayland and verify that SDL initializes Wayland and the game starts, recording the SDL version and result.

@fix can do L1 and L3.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • tests/test_video_order.py:35: Is there a current launch configuration where the selected order does not reach SDL?

Checks: Still running: 8 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: on the tested Steam Deck, Steam changed from binding its desktop app 413080 to the game's shortcut ID, and the reported face-button and trigger behavior was corrected. The presentation cost has not been measured.

Other systems: Linux Steam desktop launches on other GPUs and compositors also take the X11 path; its presentation and frame pacing are unmeasured. Game Mode and non-Steam launches retain the previous selection, and Windows does not use this display implementation. Fallback on a desktop without XWayland remains untested.

Switches: No switches added, changed or removed. Existing SDL video-driver environment overrides retain precedence.

Reviewed: f2f1637b5f against 01d6878b3f: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the diff and commit, all changed files, and the display startup fixture and caller. Skimmed references to SDL driver selection and Steam environment variables. No review checklist file was present; no translations or generated files changed.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance and the diff contains no game-derived output or generated files.
  • The existing explicit SDL driver overrides and gamescope branch remain in place.
  • The reported Deck test covers the original input failure and Game Mode.

Testing: No commands from the project were run, as requested. The author reports a successful Deck game test; CI still has checks running and one head-only failure already recorded separately.

Overlaps and merge order: Related PR #2802 is mentioned, but its contents and overlap were unavailable in the supplied context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by omgitsgela. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The Deck test shows that the controller fix works there. The presentation cost on affected desktop systems also needs measurement before merge. Steam desktop launches prefer an X11 window so Steam can apply the game's controller layout; other launches retain their existing order. This fixes the reported input problem on the tested Deck, at the cost of changing the presentation path for Steam desktop launches. **Blocking (1)**: must change before merging. 1. **L3**: The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head and passes on the base branch: Failing after 24s. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1** `host/posix/display_sdl.c:354`: The X11 presentation path's frame pacing and behavior on other affected Linux GPU drivers have not been measured. (more on the line) **Do:** Compare main and this head on affected NVIDIA and AMD Linux desktops, using the same scene and settings for multiple interleaved runs; report frame times, 1% lows and present behavior. *(`@fix` does its part first: Preserve Wayland where Steam can follow its focus, if such a detectable configuration is available.)* - **L2** `host/posix/display_sdl.c:354`: The stated fallback when XWayland is unavailable has not been tested. (more on the line) **Do:** Run a Steam launch without XWayland and verify that SDL initializes Wayland and the game starts, recording the SDL version and result. `@fix` can do L1 and L3. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - `tests/test_video_order.py:35`: Is there a current launch configuration where the selected order does not reach SDL? **Checks:** Still running: 8 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: on the tested Steam Deck, Steam changed from binding its desktop app 413080 to the game's shortcut ID, and the reported face-button and trigger behavior was corrected. The presentation cost has not been measured. **Other systems:** Linux Steam desktop launches on other GPUs and compositors also take the X11 path; its presentation and frame pacing are unmeasured. Game Mode and non-Steam launches retain the previous selection, and Windows does not use this display implementation. Fallback on a desktop without XWayland remains untested. **Switches:** No switches added, changed or removed. Existing SDL video-driver environment overrides retain precedence. **Reviewed:** f2f1637b5fd3 against 01d6878b3f14: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the diff and commit, all changed files, and the display startup fixture and caller. Skimmed references to SDL driver selection and Steam environment variables. No review checklist file was present; no translations or generated files changed.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance and the diff contains no game-derived output or generated files. - The existing explicit SDL driver overrides and gamescope branch remain in place. - The reported Deck test covers the original input failure and Game Mode. **Testing:** No commands from the project were run, as requested. The author reports a successful Deck game test; CI still has checks running and one head-only failure already recorded separately. **Overlaps and merge order:** Related PR #2802 is mentioned, but its contents and overlap were unavailable in the supplied context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by omgitsgela. Nothing was run; a maintainer decides.</sub>
@ -347,0 +351,4 @@
const int steam_launch = getenv("SteamGameId") || getenv("SteamAppId") || getenv("STEAM_COMPAT_CLIENT_INSTALL_PATH");
const char* order = hos_sdl_video_order(steam_launch, gamescope);
if (!getenv("SDL_VIDEODRIVER") && !getenv("SDL_VIDEO_DRIVER") && order)
hos_sdl_hint(hos_sdl_load() == 3 ? "SDL_VIDEO_DRIVER" : "SDL_VIDEODRIVER", order);
Member

L1 (should fix): The X11 presentation path's frame pacing and behavior on other affected Linux GPU drivers have not been measured.

When: A Steam desktop launch on a driver whose X11 surface lacks mailbox presentation now uses X11 instead of Wayland; its present mode and frame pacing can differ throughout play.

Do: Compare main and this head on affected NVIDIA and AMD Linux desktops, using the same scene and settings for multiple interleaved runs; report frame times, 1% lows and present behavior.

**L1** (should fix): The X11 presentation path's frame pacing and behavior on other affected Linux GPU drivers have not been measured. *When:* A Steam desktop launch on a driver whose X11 surface lacks mailbox presentation now uses X11 instead of Wayland; its present mode and frame pacing can differ throughout play. **Do:** Compare main and this head on affected NVIDIA and AMD Linux desktops, using the same scene and settings for multiple interleaved runs; report frame times, 1% lows and present behavior.
Member

L2 (should fix): The stated fallback when XWayland is unavailable has not been tested.

When: A Steam-launched game in a Wayland desktop without an available X11 server now asks SDL to initialize X11 first; the claimed fallback to a working Wayland window has not been observed.

Do: Run a Steam launch without XWayland and verify that SDL initializes Wayland and the game starts, recording the SDL version and result.

**L2** (should fix): The stated fallback when XWayland is unavailable has not been tested. *When:* A Steam-launched game in a Wayland desktop without an available X11 server now asks SDL to initialize X11 first; the claimed fallback to a working Wayland window has not been observed. **Do:** Run a Steam launch without XWayland and verify that SDL initializes Wayland and the game starts, recording the SDL version and result.
Author
Member

CI note: Third-party parts and guide screenshots fails here because it fails on main too. scripts/check_guide_screenshots.py --review-sources on origin/main (01d6878b) says REVIEW REQUIRED: settings-graphics.png: game/oot_cheat_items.h changed since reviewed revision 3c74597e, from #2785; neither branch touches game/. The rest of the checks are running.

CI note: `Third-party parts and guide screenshots` fails here because it fails on `main` too. `scripts/check_guide_screenshots.py --review-sources` on `origin/main` (`01d6878b`) says `REVIEW REQUIRED: settings-graphics.png: game/oot_cheat_items.h changed since reviewed revision 3c74597e`, from #2785; neither branch touches `game/`. The rest of the checks are running.
futondestroyer left a comment

Recommendation: Request changes. The Deck controller fix is reproduced and useful. Narrow the default or verify that switching the Vulkan surface preserves desktop presentation on the affected hardware.

Does it help? Yes for the reported input failure. The author’s matched Steam Deck LCD / SteamOS 7.2.7-valve2-neptune report showed Steam leave desktop layout app 413080 and bind the shortcut app -1211248510 in about a second. The face button and left trigger returned to game behavior. Game Mode and the non-Steam launch were also checked.

Blocking — host/posix/display_sdl.c:354. The new hint prefers X11 for every detected Steam desktop launch. The current renderer chooses mailbox if available and otherwise stays FIFO under Linux V-Sync Auto (gpu/vk/vk_main.cpp:1265–1293), so losing mailbox can change default frame pacing and latency. NVIDIA X11 with V-Sync Off can still pick immediate and reproduce cross-monitor tearing when the surface advertises it, the reason the Wayland preference was introduced in b54bec179. Either scope the default to an evidenced configuration or compare main and this head on Steam Deck RADV and affected NVIDIA/AMD Wayland desktops. Keep the route and settings fixed, report selected present mode and frame-time distribution/1% lows, and check the second monitor with V-Sync Off on NVIDIA.

Fallback coverage. The driver list does fall through when X11 cannot create a device, including when SDL2 cannot open DISPLAY. Once SDL chooses an X11 device, it does not try Wayland on later VideoInit, window, or Vulkan surface failure. Distinguish these cases in the description and test the missing-XWayland case. https://github.com/libsdl-org/SDL/blob/release-2.32.10/src/video/SDL_video.c#L482-L530 · https://github.com/libsdl-org/SDL/blob/release-2.32.10/src/video/x11/SDL_x11video.c#L141-L161

Checks: Exact PR run 57579 had six passes and five red jobs. All three touched/new fixtures passed. The guide error identifies game/oot_cheat_items.h changed by main #2785, outside this diff. Rust log names unchanged rustfmt and synthetic layout code. Website reports /settings/ game branding from unchanged files. The exact-base push status is pending, so do not assume the remaining failed suites passed on the base. https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/57579

Reviewed: f2f1637b5f against 01d6878b3f. No new switches. Explicit SDL driver choice and the gamescope branch still take precedence. Related #2802 changes IMU transport and tests only, with no shared changed files or required merge order.

CI comparison: all 31 failing game-free test names match the union of the two shards on disjoint sibling #2802 at the same base, although the shard assignments differ. Guide, Rust and Website failure details also match. The exact base's push run 57375 had not run those checks. https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/57577

**Recommendation: Request changes.** The Deck controller fix is reproduced and useful. Narrow the default or verify that switching the Vulkan surface preserves desktop presentation on the affected hardware. **Does it help?** Yes for the reported input failure. The author’s matched Steam Deck LCD / SteamOS 7.2.7-valve2-neptune report showed Steam leave desktop layout app 413080 and bind the shortcut app -1211248510 in about a second. The face button and left trigger returned to game behavior. Game Mode and the non-Steam launch were also checked. **Blocking** — host/posix/display_sdl.c:354. The new hint prefers X11 for every detected Steam desktop launch. The current renderer chooses mailbox if available and otherwise stays FIFO under Linux V-Sync Auto (gpu/vk/vk_main.cpp:1265–1293), so losing mailbox can change default frame pacing and latency. NVIDIA X11 with V-Sync Off can still pick immediate and reproduce cross-monitor tearing when the surface advertises it, the reason the Wayland preference was introduced in b54bec179. Either scope the default to an evidenced configuration or compare main and this head on Steam Deck RADV and affected NVIDIA/AMD Wayland desktops. Keep the route and settings fixed, report selected present mode and frame-time distribution/1% lows, and check the second monitor with V-Sync Off on NVIDIA. **Fallback coverage.** The driver list does fall through when X11 cannot create a device, including when SDL2 cannot open DISPLAY. Once SDL chooses an X11 device, it does not try Wayland on later VideoInit, window, or Vulkan surface failure. Distinguish these cases in the description and test the missing-XWayland case. https://github.com/libsdl-org/SDL/blob/release-2.32.10/src/video/SDL_video.c#L482-L530 · https://github.com/libsdl-org/SDL/blob/release-2.32.10/src/video/x11/SDL_x11video.c#L141-L161 **Checks:** Exact PR run 57579 had six passes and five red jobs. All three touched/new fixtures passed. The guide error identifies game/oot_cheat_items.h changed by main #2785, outside this diff. Rust log names unchanged rustfmt and synthetic layout code. Website reports /settings/ game branding from unchanged files. The exact-base push status is pending, so do not assume the remaining failed suites passed on the base. https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/57579 **Reviewed:** f2f1637b5fd3e583836cba88553ed1f6e54e4a79 against 01d6878b3f148e68d7a9080133d193e1fb7c2973. No new switches. Explicit SDL driver choice and the gamescope branch still take precedence. Related #2802 changes IMU transport and tests only, with no shared changed files or required merge order. CI comparison: all 31 failing game-free test names match the union of the two shards on disjoint sibling #2802 at the same base, although the shard assignments differ. Guide, Rust and Website failure details also match. The exact base's push run 57375 had not run those checks. https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/57577
@ -347,0 +351,4 @@
const int steam_launch = getenv("SteamGameId") || getenv("SteamAppId") || getenv("STEAM_COMPAT_CLIENT_INSTALL_PATH");
const char* order = hos_sdl_video_order(steam_launch, gamescope);
if (!getenv("SDL_VIDEODRIVER") && !getenv("SDL_VIDEO_DRIVER") && order)
hos_sdl_hint(hos_sdl_load() == 3 ? "SDL_VIDEO_DRIVER" : "SDL_VIDEODRIVER", order);
Member

[P2] Narrow this default or verify presentation on affected Steam Wayland desktops. Preferring X11 changes the Vulkan surface, so V-Sync Auto can move from mailbox to FIFO and alter latency or pacing. Include present-mode selection and a matched frame-time comparison on configurations covered by the new default.

[P2] Narrow this default or verify presentation on affected Steam Wayland desktops. Preferring X11 changes the Vulkan surface, so V-Sync Auto can move from mailbox to FIFO and alter latency or pacing. Include present-mode selection and a matched frame-time comparison on configurations covered by the new default.
omgitsgela force-pushed fix/deck-x11-under-steam from f2f1637b5f
Some checks failed
PR description / Title and description (pull_request_target) Successful in 15s
CI / What the change needs (pull_request) Successful in 21s
CI / Third-party parts and guide screenshots (pull_request) Failing after 24s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 24s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m11s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m18s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m47s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m50s
CI / Website build and checks (pull_request) Failing after 1m23s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 21m14s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 31m50s
to 5d9ed3d099
Some checks failed
CI / What the change needs (pull_request) Successful in 15s
CI / Third-party parts and guide screenshots (pull_request) Failing after 22s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 22s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m46s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 2m41s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m59s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m20s
CI / Website build and checks (pull_request) Failing after 1m17s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 29m19s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 34m34s
2026-11-29 14:57:34 +00:00
Compare
omgitsgela changed title from fix(linux): a Steam launch on a Wayland desktop asks for an X11 window, so Steam follows the focus to fix(linux): a Steam launch on the Deck's desktop asks for an X11 window, so Steam follows the focus 2026-11-29 15:05:12 +00:00
Author
Member

Scoped, as the review asked (5d9ed3d0).

  • The default now needs all three: Steam started the process, gamescope is not the compositor, and the machine is a Steam Deck (Jupiter or Galileo from /sys/devices/virtual/dmi/id/product_name). Every other machine keeps wayland,x11, exactly as on main, so no other desktop's presentation path changes and there is no unmeasured cost left outside the Deck. Widening the rule beyond it is the follow-up, and it needs the matched frame-time comparison (present mode, 1% lows) on the drivers in question rather than an argument.
  • What is still unmeasured is now stated plainly: frame pacing of the X11 path against main's Wayland path on the Deck itself, which is in Still to test, along with the no-XWayland session.
  • On your question about the order not reaching SDL: yes, two cases, and both are intended. The hint is skipped entirely when SDL_VIDEODRIVER or SDL_VIDEO_DRIVER is already set, and under gamescope the function returns nothing. Otherwise SDL tries the drivers in the given order and takes the first that initializes, so the X11 entry is a preference that Wayland still answers when X11 cannot open a display.
  • The guide-screenshot failure is on the base: game/oot_cheat_items.h from #2785, outside this diff, as you said.
Scoped, as the review asked (`5d9ed3d0`). - **The default now needs all three**: Steam started the process, gamescope is not the compositor, and the machine is a Steam Deck (`Jupiter` or `Galileo` from `/sys/devices/virtual/dmi/id/product_name`). Every other machine keeps `wayland,x11`, exactly as on `main`, so no other desktop's presentation path changes and there is no unmeasured cost left outside the Deck. Widening the rule beyond it is the follow-up, and it needs the matched frame-time comparison (present mode, 1% lows) on the drivers in question rather than an argument. - **What is still unmeasured** is now stated plainly: frame pacing of the X11 path against `main`'s Wayland path on the Deck itself, which is in Still to test, along with the no-XWayland session. - **On your question** about the order not reaching SDL: yes, two cases, and both are intended. The hint is skipped entirely when `SDL_VIDEODRIVER` or `SDL_VIDEO_DRIVER` is already set, and under gamescope the function returns nothing. Otherwise SDL tries the drivers in the given order and takes the first that initializes, so the X11 entry is a preference that Wayland still answers when X11 cannot open a display. - **The guide-screenshot failure** is on the base: `game/oot_cheat_items.h` from #2785, outside this diff, as you said.
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported Deck controller failure is fixed in the author's test, and the new default is limited to Decks. The affected X11 path still needs a frame-pacing comparison and the no-XWayland fallback needs a run. Recommend approval; not approved on the forge.

Steam launches on a Deck desktop prefer X11 so Steam can bind the game's controller layout; other desktops keep the previous Wayland preference. This confines the presentation tradeoff to the affected hardware, at the cost of an unmeasured change to its presentation path.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L1 host/posix/display_sdl.c:354: The Deck's X11 presentation path has not been compared with main's Wayland path. When: A Steam launch in Deck Desktop Mode now uses X11 first, which can select a different Vulkan present mode and change frame pacing. Do: Compare main and this head on the Deck in the same scene and settings with interleaved runs, reporting present mode and frame-time distribution and 1% lows. (@fix does its part first: Preserve Wayland where Steam can follow its focus, if such a detectable configuration is available.)
  • L2 host/posix/display_sdl.c:354: The stated fallback when XWayland is unavailable has not been tested. When: A Steam-launched game in a Wayland desktop without an available X11 server now asks SDL to initialize X11 first; the claimed fallback to a working Wayland window has not been observed. Do: Run a Steam launch without XWayland and verify that SDL initializes Wayland and the game starts, recording the SDL version and result.

@fix can do L1.

Since the last review (on f2f1637b5f)
Still open: L1 (The Deck's X11 presentation path has not been compared with main's Wayland path.); L2 (The stated fallback when XWayland is unavailable has not been tested.); L3 (The check CI / Third-party parts and guide screenshots (pull_request) fails on this head…)

Checks: Failing on this head, which is behind its base, where they pass: CI / Third-party parts and guide screenshots (pull_request), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Website build and checks (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request). @rebase (or @fix) brings it up to date and runs them again; not held against it.

More: does it help, other systems, switches, what was read

Does it help: Yes for the reported input bug: the author's Steam Deck LCD test moved Steam's binding from desktop app 413080 to the game's shortcut app, and the controller worked in game. Frame pacing against main was not measured.

Other systems: Game Mode retains SDL's own order, and non-Deck machines retain Wayland first. Explicit SDL driver choices still take precedence. Deck X11 presentation and the missing-XWayland fallback remain unmeasured.

Switches: None added, changed or removed. Existing SDL driver environment overrides remain authoritative.

Reviewed: 5d9ed3d099 against 01d6878b3f: Read the diff, commit, repository rules, PR template, standards, video-order header and test, and display initialization and its surrounding code. Skimmed the two adapted display fixtures and renderer present-mode selection; other renderer code was not read in full. Tooling's adjacent rules checkout and docs/review-checklist.md were unavailable.; nothing run (a code review).

Checked and fine:

  • The Deck LCD and OLED product names are recognized, and gamescope returns SDL's own order.
  • The author reports successful in-game testing on the Deck and unchanged Game Mode behavior.
  • The reported CI failures are not identified as head-only failures.

Testing: No commands from the project or tests were run. The author reports in-game Deck testing and game-free checks; the missing frame-pacing and fallback runs remain.

Overlaps and merge order: Related PR #2802 changes IMU transport and tests; the prior review reports no shared changed files or required merge order.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The reported Deck controller failure is fixed in the author's test, and the new default is limited to Decks. The affected X11 path still needs a frame-pacing comparison and the no-XWayland fallback needs a run. Recommend approval; not approved on the forge. Steam launches on a Deck desktop prefer X11 so Steam can bind the game's controller layout; other desktops keep the previous Wayland preference. This confines the presentation tradeoff to the affected hardware, at the cost of an unmeasured change to its presentation path. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1** `host/posix/display_sdl.c:354`: The Deck's X11 presentation path has not been compared with main's Wayland path. *When:* A Steam launch in Deck Desktop Mode now uses X11 first, which can select a different Vulkan present mode and change frame pacing. **Do:** Compare main and this head on the Deck in the same scene and settings with interleaved runs, reporting present mode and frame-time distribution and 1% lows. *(`@fix` does its part first: Preserve Wayland where Steam can follow its focus, if such a detectable configuration is available.)* - **L2** `host/posix/display_sdl.c:354`: The stated fallback when XWayland is unavailable has not been tested. *When:* A Steam-launched game in a Wayland desktop without an available X11 server now asks SDL to initialize X11 first; the claimed fallback to a working Wayland window has not been observed. **Do:** Run a Steam launch without XWayland and verify that SDL initializes Wayland and the game starts, recording the SDL version and result. `@fix` can do L1. **Since the last review** (on f2f1637b5fd3) Still open: L1 (The Deck's X11 presentation path has not been compared with main's Wayland path.); L2 (The stated fallback when XWayland is unavailable has not been tested.); L3 (The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head…) **Checks:** Failing on this head, which is behind its base, where they pass: `CI / Third-party parts and guide screenshots (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Website build and checks (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`. `@rebase` (or `@fix`) brings it up to date and runs them again; not held against it. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported input bug: the author's Steam Deck LCD test moved Steam's binding from desktop app 413080 to the game's shortcut app, and the controller worked in game. Frame pacing against main was not measured. **Other systems:** Game Mode retains SDL's own order, and non-Deck machines retain Wayland first. Explicit SDL driver choices still take precedence. Deck X11 presentation and the missing-XWayland fallback remain unmeasured. **Switches:** None added, changed or removed. Existing SDL driver environment overrides remain authoritative. **Reviewed:** 5d9ed3d099b3 against 01d6878b3f14: Read the diff, commit, repository rules, PR template, standards, video-order header and test, and display initialization and its surrounding code. Skimmed the two adapted display fixtures and renderer present-mode selection; other renderer code was not read in full. Tooling's adjacent rules checkout and docs/review-checklist.md were unavailable.; nothing run (a code review). **Checked and fine:** - The Deck LCD and OLED product names are recognized, and gamescope returns SDL's own order. - The author reports successful in-game testing on the Deck and unchanged Game Mode behavior. - The reported CI failures are not identified as head-only failures. **Testing:** No commands from the project or tests were run. The author reports in-game Deck testing and game-free checks; the missing frame-pacing and fallback runs remain. **Overlaps and merge order:** Related PR #2802 changes IMU transport and tests; the prior review reports no shared changed files or required merge order. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
omgitsgela force-pushed fix/deck-x11-under-steam from 5d9ed3d099
Some checks failed
CI / What the change needs (pull_request) Successful in 15s
CI / Third-party parts and guide screenshots (pull_request) Failing after 22s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 22s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m46s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 2m41s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m59s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m20s
CI / Website build and checks (pull_request) Failing after 1m17s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 29m19s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 34m34s
to 0e37493314
Some checks failed
CI / What the change needs (pull_request) Successful in 14s
CI / Third-party parts and guide screenshots (pull_request) Failing after 23s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 24s
PR description / Title and description (pull_request_target) Successful in 9s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m14s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m46s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m59s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m17s
CI / Website build and checks (pull_request) Failing after 1m40s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 21m28s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 38m27s
2026-11-29 16:39:02 +00:00
Compare
Author
Member

Deck-only rule tested on a Steam Deck LCD (DMI Jupiter, vendor Valve), with this head (0e374933) built on the Deck itself (longshot-builder, compile only, shaders at first start):

  • Launch variables set: the game opens an X11 window. xdotool finds Longshot and getwindowpid is the game's own pid.
  • Same variables exported but empty (a wrapper's placeholder): no X11 window at all, so SDL runs it on Wayland. Before this head, an empty value counted as a Steam launch and it too went to X11; hos_env_set now treats it as unset.
  • Same build, same session, same settings; the title came up and the game ran at 120-137 fps in both cases.

What that does and does not say: the rule reaches SDL and changes the window type on the Deck, and it does nothing without the launch markers. It does not measure frame pacing of the X11 path against main's Wayland path, which is still in Still to test along with a session that has no XWayland.

On hardware the fallback also ran in this build: see #2802's comment for the gyro side.

Deck-only rule tested on a Steam Deck LCD (DMI `Jupiter`, vendor `Valve`), with this head (0e374933) built on the Deck itself (longshot-builder, compile only, shaders at first start): - Launch variables set: the game opens an **X11** window. `xdotool` finds `Longshot` and `getwindowpid` is the game's own pid. - Same variables exported but empty (a wrapper's placeholder): **no X11 window at all**, so SDL runs it on Wayland. Before this head, an empty value counted as a Steam launch and it too went to X11; `hos_env_set` now treats it as unset. - Same build, same session, same settings; the title came up and the game ran at 120-137 fps in both cases. What that does and does not say: the rule reaches SDL and changes the window type on the Deck, and it does nothing without the launch markers. It does not measure frame pacing of the X11 path against main's Wayland path, which is still in Still to test along with a session that has no XWayland. On hardware the fallback also ran in this build: see #2802's comment for the gyro side.
Author
Member

Ready for another look: the head is 0e374933, rebased onto the new main (f14a5664) and mergeable. The default is now the Deck only, an empty SteamGameId no longer counts, and both cases were exercised on the Deck as described above.

Ready for another look: the head is 0e374933, rebased onto the new `main` (f14a5664) and mergeable. The default is now the Deck only, an empty `SteamGameId` no longer counts, and both cases were exercised on the Deck as described above.
Author
Member

Frame pacing and the no-XWayland case are now measured on the Deck, same build, same settings (V-Sync Auto, swapchain 1152x718), same title scene, present-to-present from RX_VK_FRAME_TRACE; both runs log vk: swapchain 1152x718, 4 images, mailbox (V-Sync Auto), so the X11 swapchain keeps mailbox on RADV:

frames 600-9600 mean p95 p99 1% low worst over 16.7 ms
X11 (this branch) 7.17 ms, 139.4 fps 14.03 22.68 28.86 72.0 2.78%
Wayland (same build, forced) 7.19 ms, 139.1 fps 14.03 22.62 28.85 67.2 2.74%

Whole runs including startup: 7.06 against 6.95 ms mean, 1% low 30.03 against 30.16, worst 311 against 318 ms.

No XWayland: with DISPLAY unset so no X11 display can open, the same Steam-marked launch still starts (Wayland window, 6121 frames, mailbox, no X11 window, exit 0).

That leaves the OLED Deck, which I cannot run. Description updated with all of it.

Frame pacing and the no-XWayland case are now measured on the Deck, same build, same settings (V-Sync Auto, swapchain 1152x718), same title scene, present-to-present from `RX_VK_FRAME_TRACE`; both runs log `vk: swapchain 1152x718, 4 images, mailbox (V-Sync Auto)`, so the X11 swapchain keeps mailbox on RADV: | frames 600-9600 | mean | p95 | p99 | 1% low | worst | over 16.7 ms | |---|---|---|---|---|---|---| | X11 (this branch) | 7.17 ms, 139.4 fps | 14.03 | 22.68 | 28.86 | 72.0 | 2.78% | | Wayland (same build, forced) | 7.19 ms, 139.1 fps | 14.03 | 22.62 | 28.85 | 67.2 | 2.74% | Whole runs including startup: 7.06 against 6.95 ms mean, 1% low 30.03 against 30.16, worst 311 against 318 ms. No XWayland: with `DISPLAY` unset so no X11 display can open, the same Steam-marked launch still starts (Wayland window, 6121 frames, mailbox, no X11 window, exit 0). That leaves the OLED Deck, which I cannot run. Description updated with all of it.
Author
Member

Short answer: no, not from inside the game, and the reason is on Steam's side.

In Desktop Mode the Steam client is itself an X11 client. On the Deck right now: Xwayland :0 -rootless is running, and Steam's own windows (name Steam) belong to steamwebhelper and are X11 windows. From what can be observed, its controller binding follows the focused X11 window: with a native Wayland window Steam kept the desktop app (413080) bound even though it was the only thing on screen, and with an X11 window it binds the game's own id within about a second.

A Wayland-native window cannot become that window. Wayland gives a client no way to announce itself to another client, and Steam exposes no call or variable through which a game hands over its app id; even a Wayland-native Steam would need the compositor's foreign-toplevel to tell it what is focused, and would still have to map that to an app itself. So the window type is the only lever the game has, which is why the change is that and nothing more.

It costs nothing extra on Plasma, because XWayland is already running for Steam's own client; and where there is no X11 display at all the code falls through to Wayland and the game starts anyway (measured on the Deck with DISPLAY unset: Wayland window, 6121 frames, mailbox, exit 0).

Game Mode is untouched: gamescope owns the session, Steam knows what it launched, and the hint returns nothing there.

So yes, it would be more natural for Steam to follow a Wayland window, but that is Steam's change to make. If it ever tracks Wayland toplevels, this rule collapses back to a one-line default and can be deleted. If you would rather keep Wayland and live with the controller bug until then, that is a legitimate product call, just not something the game can fix from its side.

Short answer: no, not from inside the game, and the reason is on Steam's side. In Desktop Mode the Steam client is itself an X11 client. On the Deck right now: `Xwayland :0 -rootless` is running, and Steam's own windows (name `Steam`) belong to `steamwebhelper` and are X11 windows. From what can be observed, its controller binding follows the focused X11 window: with a native Wayland window Steam kept the desktop app (413080) bound even though it was the only thing on screen, and with an X11 window it binds the game's own id within about a second. A Wayland-native window cannot become that window. Wayland gives a client no way to announce itself to another client, and Steam exposes no call or variable through which a game hands over its app id; even a Wayland-native Steam would need the compositor's foreign-toplevel to tell it what is focused, and would still have to map that to an app itself. So the window type is the only lever the game has, which is why the change is that and nothing more. It costs nothing extra on Plasma, because XWayland is already running for Steam's own client; and where there is no X11 display at all the code falls through to Wayland and the game starts anyway (measured on the Deck with `DISPLAY` unset: Wayland window, 6121 frames, mailbox, exit 0). Game Mode is untouched: gamescope owns the session, Steam knows what it launched, and the hint returns nothing there. So yes, it would be more natural for Steam to follow a Wayland window, but that is Steam's change to make. If it ever tracks Wayland toplevels, this rule collapses back to a one-line default and can be deleted. If you would rather keep Wayland and live with the controller bug until then, that is a legitimate product call, just not something the game can fix from its side.
HumanBean deleted branch fix/deck-x11-under-steam 2026-11-29 17:21:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2803
No description provided.