Skip to content

fix: let Electron select the Wayland display - #4268

Merged
KristjanESPERANTO merged 2 commits into
MagicMirrorOrg:developfrom
flightlesstux:upstream-wayland-fix
Sep 26, 2026
Merged

KristjanESPERANTO merged 2 commits into
MagicMirrorOrg:developfrom
flightlesstux:upstream-wayland-fix

Conversation

@flightlesstux

Copy link
Copy Markdown

WAYLAND_DISPLAY falls back to wayland-1 when it's not set. On my Pi the real socket is wayland-0, so electron connected to nothing and crashed on every launch. Since pm2 auto-restarts the process, this turned into a crash loop that filled my disk with core dumps and broke git, npm and pm2 along with it.

This checks XDG_RUNTIME_DIR for the actual wayland-* socket and only falls back to wayland-0 if nothing is found.

Tested manually with a socket present, no socket, and WAYLAND_DISPLAY already set. Ran node --run lint:fix, no issues.

WAYLAND_DISPLAY fell back to wayland-1 when unset, but that's not
the real socket on every setup (wayland-0 on mine). With a saved
pm2 env that never set WAYLAND_DISPLAY, electron connected to the
wrong socket and SIGSEGV'd on every launch, and pm2's auto-restart
turned that into a crash loop.

Now it checks XDG_RUNTIME_DIR for the actual wayland-* socket first
and only falls back to wayland-0 if it can't find one.
Comment thread package.json Outdated
@KristjanESPERANTO KristjanESPERANTO changed the title fix: start:wayland defaults to wrong compositor socket fix: let Electron select the Wayland display Sep 26, 2026
@KristjanESPERANTO
KristjanESPERANTO merged commit 8987802 into MagicMirrorOrg:develop Sep 26, 2026
13 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.

4 participants