Repository navigation
feat(videoout): use native Wayland on Linux - #3664
Conversation
|
All three claims that decide whether this is safe check out against the vendored SDL2.
One thing I would ask about, because it changes behaviour for every Linux user rather than only Wayland sessions. Preferring Wayland when the session provides it is clearly right. The question is whether the default should flip in this PR or behind a documented option, given that the fallback paths are only exercised by some sessions — no The note about #3574 touching the same Written with AI assistance. |
de48e12 to
b02ef22
Compare
|
Tested on Hyprland (Omarchy, Arch) with an Intel GPU (Core Ultra X7 358H, Xe, Mesa 26.2.2 ANV), Release, this PR (b02ef22) merged onto Native Wayland, no X server and no
All four were still running at 25 s; screenshots match what they draw under XWayland. One caveat about the documented override: Tested with Claude Code assistance. |
adriadam10
left a comment
There was a problem hiding this comment.
The change looks right and the third-party runs on KDE and Hyprland cover it. It now conflicts with main:
.github/workflows/build.ymland.github/workflows/release.yml: the apt-get line now also installslibpipewire-0.3-dev libpulse-dev libasound2-dev; keep those and appendlibwayland-dev libxkbcommon-dev libegl-dev libdecor-0-dev.docs/dev/BUILD.md: the Linux requirements line gained the audio packages; join it with the Wayland text.
Please rebase on current main and push; it can be merged once CI is green.
b02ef22 to
040d2f5
Compare
|
Rebased onto current
Built locally on Linux (Release), and SDL configures with both backends: AI-assisted: yes (Claude Code) |
Build SDL's Wayland backend next to X11 and ask SDL for "wayland,x11" on Linux, so the window runs natively under a Wayland compositor instead of through XWayland. SDL loads libwayland, xkbcommon and libdecor at run time, so systems without them, or sessions without WAYLAND_DISPLAY, keep using X11. SDL_VIDEODRIVER still overrides the choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
040d2f5 to
040873f
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
Rebased onto current |
What
On Linux the window now runs natively under a Wayland compositor instead of through XWayland.
CMakeLists.txt: build SDL's Wayland backend (SDL_WAYLAND ON) next to X11. SDL's defaults are kept: libwayland-client/-cursor/-egl, xkbcommon and libdecor are loaded withdlopenat run time, so the binary gains no new link-time dependencies.VideoOutDriver: on Linux, setSDL_HINT_VIDEODRIVERtowayland,x11beforeSDL_InitSubSystem(VIDEO). SDL2 lists X11 first in its bootstrap order, so without the hint it picks XWayland even in a Wayland session.WAYLAND_DISPLAY(and the session isn'twayland) or the libraries are missing, then uses X11. AnSDL_VIDEODRIVERenvironment variable still wins over the hint, soSDL_VIDEODRIVER=x11gets XWayland back. The ctest flip tests, which setSDL_VIDEODRIVER=offscreen, also keep their driver.build.yml,release.yml): installlibwayland-dev libxkbcommon-dev libegl-dev libdecor-0-dev, so the Linux release includes the backend. Without these packages configuration still succeeds and the build has X11 only.docs/dev/BUILD.md: lists the packages (Debian/Ubuntu and Fedora) and theSDL_VIDEODRIVER=x11override.Overlap: #3574 edits the same apt-get lines in both workflows and the same BUILD.md line. Whichever lands second only needs both package lists joined.
Tested
Arch Linux, KDE Plasma (Wayland), GCC, Release, RADV (RX 9070 XT), on main a11c8f7.
color views of several array slices are unsupported, Layered rendering: a draw into all slices of a 3D color target aborts with "color views of several array slices are unsupported" #2102), the same as under X11.SDL_VIDEODRIVER=x11, and a run withWAYLAND_DISPLAYunset andXDG_SESSION_TYPE=x11: libX11 is loaded, libdecor is not, and the swapchain is created as before.video_out_flip_tests(lifetime, reopen, controls, overlay) withANYPS5_REQUIRE_DISPLAY=1and noSDL_VIDEODRIVER, so they run on native Wayland: all pass.ctest: 832/832 (the 5 display/device tests skip as on main).tools/check_conventions.pypasses.🤖 Generated with Claude Code
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Assisted by Claude Code