Skip to content

fix: handle absolute WAYLAND_DISPLAY in -d desktop binding#13

Open
netpleb wants to merge 1 commit into
rti:mainfrom
netpleb:fix/xdg-path-issue
Open

fix: handle absolute WAYLAND_DISPLAY in -d desktop binding#13
netpleb wants to merge 1 commit into
rti:mainfrom
netpleb:fix/xdg-path-issue

Conversation

@netpleb

@netpleb netpleb commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

WAYLAND_DISPLAY may be an absolute path, in which case XDG_RUNTIME_DIR must not be prepended. The old code always concatenated them, producing a malformed path like /run/user/1001//run/user/1000/wayland-0 and a bwrap "Can't find source path" error. Detect the absolute form, use it as-is, and guard the bind with an existence check.

WAYLAND_DISPLAY and XAUTHORITY may each be either a bare name (resolved
relative to XDG_RUNTIME_DIR and $HOME respectively) or an absolute path.
The old code always prepended the base directory, so an absolute value
produced a malformed path like /run/user/1001//run/user/1000/wayland-0
or /home/alice//run/user/1000/.mutter-Xwaylandauth.XXXXXX, causing a
bwrap "Can't find source path" error and breaking -d desktop access.

Detect the absolute form for both and use it as-is, otherwise resolve
relative to the base as before. Guard each bind with an existence check
so a stale/missing socket or auth file is skipped instead of crashing
bwrap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@netpleb netpleb force-pushed the fix/xdg-path-issue branch from 335de9d to 1d34fdb Compare June 4, 2026 15:02
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