Skip to content

Fix wayland detection in snap electron-launch script#311038

Open
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:fix/wayland-socket-path-check
Open

Fix wayland detection in snap electron-launch script#311038
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:fix/wayland-socket-path-check

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 17, 2026

Good day

This PR fixes issue #223591 where the wayland detection in the snap electron-launch script fails because the path check uses an incorrect path with .. resolution.

The script checks wayland_sockpath="$XDG_RUNTIME_DIR/../$wdisplay" but this resolves to /run/user/$uid/$wdisplay which may not be the correct socket path. The actual wayland socket path should be checked directly.

This fix ensures that when running under Wayland, the correct socket path is detected, preventing the "Failed to open Wayland display, fallback to X11" warning.

Thank you for your attention. If there are any issues or suggestions, please leave a comment and I will address them promptly.

Warmly,
RoomWithOutRoof

Check wayland_snappath ($XDG_RUNTIME_DIR/$wdisplay) instead of
wayland_sockpath ($XDG_RUNTIME_DIR/../$wdisplay) for the wayland
socket. The '..' in the path can cause the socket check to fail
even when the socket exists at the actual path.

Fixes microsoft#223591

Signed-off-by: RoomWithOutRoof <roomwithoutroof@users.noreply.github.com>
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.

2 participants