fix(launcher): stabilize GNOME Wayland multi-monitor scaling#702
Conversation
| local output first_line count | ||
|
|
||
| [ -n "${DISPLAY:-}" ] || return 1 | ||
| command -v xrandr >/dev/null 2>&1 || return 1 |
There was a problem hiding this comment.
This is an auto review done by revuto.
This makes the new default launch decision depend on an xrandr executable being present, but the packaged artifacts don't currently guarantee that CLI: the Debian control file only depends on libxrandr2, the RPM/Arch metadata only list the RandR libraries, and the Nix wrapper's launcherPath doesn't include xorg.xrandr. On a minimal packaged/Nix install command -v xrandr will fail, gnome_wayland_multi_monitor_detected returns false, and a GNOME Wayland dual-monitor session still gets --ozone-platform-hint=auto—the path this PR is trying to avoid. Please add the appropriate xrandr runtime dependency/wrapper entry or use a signal that is already guaranteed to be available.
3dd519e to
13c9be4
Compare
|
Updated the launcher auto-detection path to avoid the undeclared I also added a smoke test using |
ilysenko
left a comment
There was a problem hiding this comment.
Looks good. The updated launcher fallback is scoped to GNOME Wayland multi-monitor auto mode, preserves explicit rendering choices, removes the undeclared xrandr dependency, and the focused smoke coverage plus CI are green.
Summary
This PR stabilizes Codex Desktop startup on GNOME Wayland sessions with multiple monitors by selecting the X11/XWayland Ozone backend automatically when the launcher is in its default
autorendering mode.Root Cause
On GNOME Wayland multi-monitor setups, Electron 42 can pick the native Wayland backend through
--ozone-platform-hint=auto. In that backend, moving pointer focus across displays can trigger display/scale related window state changes. On an installed package this showed up as a maximized Codex window suddenly shrinking/rescaling when the pointer moved to a side monitor, while other desktop apps remained stable.The installed launcher already had manual escape hatches (
CODEX_OZONE_PLATFORM=x11,CODEX_FORCE_DEVICE_SCALE_FACTOR, and explicit--x11/--waylandflags), but the default path still left backend selection to Electron on the affected GNOME Wayland multi-monitor layout.Fix
/sys/class/drm, avoiding any undeclared runtime tool dependency.autorendering mode, force--ozone-platform=x11for that layout instead of passing--ozone-platform-hint=auto.--wayland,--ozone-platform=*,CODEX_OZONE_PLATFORM=*, andCODEX_LINUX_RENDERING_MODE=default|wayland-gpu|wslgstill win.Generality
This is intentionally broader than one machine but still scoped. The fallback applies to the class of GNOME Wayland sessions with more than one monitor, which is where Electron's native Wayland backend is most likely to encounter monitor-dependent scale/maximize drift. It does not change single-monitor sessions, WSLg, non-GNOME desktops, or any launch where the user explicitly requested a backend.
If future Electron/GNOME versions make native Wayland reliable for this layout, users can already opt back in with
CODEX_OZONE_PLATFORM=waylandorCODEX_LINUX_RENDERING_MODE=default, and the condition can be relaxed later.Validation
bash -n install.sh && bash -n scripts/lib/*.sh && bash -n launcher/start.sh.template && bash -n scripts/build-deb.sh && bash -n scripts/build-rpm.sh && bash -n scripts/build-pacman.sh && bash -n scripts/build-appimage.shgit diff --checkbash tests/scripts_smoke.sh