Skip to content

server: set no Wayland or toolkit variables without a compositor - #143

Merged
jsegaran merged 1 commit into
yas-run:mainfrom
indent-com:fix/session-env-without-compositor
Nov 4, 2026
Merged

jsegaran merged 1 commit into
yas-run:mainfrom
indent-com:fix/session-env-without-compositor

Conversation

@jsegaran

@jsegaran jsegaran commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

On macOS (and any non-Linux host) every PTY gets WAYLAND_DISPLAY= and the Wayland toolkit pins: QT_QPA_PLATFORM=wayland, GDK_BACKEND=wayland, SDL_VIDEODRIVER=wayland, XDG_SESSION_TYPE=wayland, ELECTRON_OZONE_PLATFORM_HINT=wayland, MOZ_ENABLE_WAYLAND=1, NIXOS_OZONE_WL=1. A Qt app then aborts with "Could not find the Qt platform plugin "wayland" ... Available platform plugins are: cocoa". We hit it with the Android emulator in windowed mode.

Off Linux, spawn_compositor is a stub whose socket_name is empty, but the PTY spawns and prepare_session_env still pass Some("") to app_env::session_env, and session_env only checked if let Some(wd). It now treats an empty socket name as no display. Linux is unchanged: a real compositor always has a non-empty socket path.

an_empty_socket_name_sets_no_display_variables covers it. cargo test -p yas-server --lib app_env and cargo fmt -- --check pass on this branch, and cargo clippy -p yas-server --all-targets -- -D warnings passed on the same change against the fork. The identical test fails without the fix (checked in blit, which has the same code).

View in Indent
Tag @indent to continue the conversation here.

Off Linux the compositor is a stub whose socket name is empty, but PTY and
session-env spawns still passed Some("") to session_env, which exported an
empty WAYLAND_DISPLAY and pinned Qt, GTK, SDL, Electron and Firefox to
Wayland. On macOS a Qt app then aborts: "Could not find the Qt platform
plugin wayland ... Available platform plugins are: cocoa".
@indent
indent Bot force-pushed the fix/session-env-without-compositor branch from 243cb9f to 9229ae6 Compare November 4, 2026 09:55
@jsegaran
jsegaran merged commit 696414c into yas-run:main Nov 4, 2026
11 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