Skip to content

Force X11 for Xenia on Wayland - #52

Merged
btsouth merged 1 commit into
mainfrom
fix/xenia-wayland-x11
Sep 16, 2026
Merged

btsouth merged 1 commit into
mainfrom
fix/xenia-wayland-x11

Conversation

@btsouth

@btsouth btsouth commented Sep 16, 2026

Copy link
Copy Markdown
Owner

On a Wayland session, Xenia's Linux build opens a GTK window but only creates an XCB (X11) Vulkan surface. The window and the surface never match, so the swapchain never presents: the emulator shows a grey, unresponsive window while the guest keeps running and audio keeps playing.

Reproduced with Xenia Canary (canary_experimental@02d2cb5cc) on Hyprland: grey window, dead menu bar, working sound. Running with GDK_BACKEND=x11 makes video appear immediately.

Change:

  • launchXenia now detects a Wayland session (WAYLAND_DISPLAY or XDG_SESSION_TYPE=wayland) and launches with GDK_BACKEND=x11 and SDL_VIDEODRIVER=x11.
  • Existing values in the environment are respected, so a user override still wins.
  • The environment helper is a small static function so it is unit tested.

Tests: adds xeniaLaunchForcesX11OnWayland (Wayland gets x11, non-Wayland is untouched, explicit overrides win). Core suite: 212 passed, 0 failed, 1 skipped.

Found while validating Xenia with a real Xbox 360 disc.

Summary by CodeRabbit

  • Bug Fixes
    • Improved launching on Wayland desktop sessions by configuring X11-compatible graphics and video settings when needed.
    • Prevented launch issues associated with Wayland graphics handling while preserving any existing user-defined environment settings.
    • Launch behavior for non-Wayland sessions remains unchanged.

Xenia's Linux build opens a GTK window on Wayland but only creates an XCB (X11)
Vulkan surface, so the swapchain never presents and the window hangs grey while
audio keeps playing.

Detect a Wayland session in launchXenia and pin GDK_BACKEND and SDL_VIDEODRIVER
to x11 for the emulator. Explicit values in the environment are left untouched.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b96f6344-7aa1-4c17-9c2e-d31e89fb9b38

📥 Commits

Reviewing files that changed from the base of the PR and between 696082c and 898528a.

📒 Files selected for processing (3)
  • src/launch/GameLauncher.cpp
  • src/launch/GameLauncher.h
  • tests/CoreTests.cpp

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

launchXenia detects Wayland sessions and starts Xenia with a derived environment. The new helper sets missing GDK_BACKEND and SDL_VIDEODRIVER values to x11 while preserving existing values. Tests cover Wayland, non-Wayland, and override cases.

Changes

Wayland X11 launch

Layer / File(s) Summary
Launch environment contract
src/launch/GameLauncher.h, src/launch/GameLauncher.cpp
Adds xeniaLaunchEnvironment, which preserves the base environment and supplies missing X11 backend values on Wayland.
Xenia launch integration and validation
src/launch/GameLauncher.cpp, tests/CoreTests.cpp
launchXenia detects Wayland and passes the derived environment to startCommand. Tests verify backend values, non-Wayland behavior, and user overrides.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: karem505

Merge Risk: ⚪ Minimal · up to 89852

The Wayland launch compatibility change preserves existing user overrides and normal launch behavior, with no unresolved merge-readiness risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: forcing X11 for Xenia during Wayland sessions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/xenia-wayland-x11

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@btsouth
btsouth merged commit 6c1064d into main Sep 16, 2026
9 checks passed
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