super-productivity/docs/research
Johannes Millan bffbbaed5b docs(research): §18.7 — source-level mechanism for appendSwitch vs argv divergence
Trace the root cause to Electron's init order: Ozone platform selection
fires in C++ PreEarlyInitialization() and the chosen platform is
memoized in ui/ozone/platform_selection.cc's g_selected_platform
static. Any app.commandLine.appendSwitch() from main.js runs in
PostEarlyInitialization() — after the memoization, so the write is
correct but the read has already happened. Primary source: electron
PR #48301 diff + Chromium ui/ozone/platform_selection.cc.

This confirms the argv wrapper is structurally the only fix available
from outside the Electron binary. Also documents why the two
lower-friction alternatives don't work:

- ELECTRON_OZONE_PLATFORM_HINT env var was removed as dead code in
  Electron 39 (PR #47983).
- Setting XDG_SESSION_TYPE=x11 via snapcraft.yaml environment: would
  work for Ozone but would fool IdleTimeHandler, silently breaking
  GNOME Wayland idle detection.

Confidence in the mechanism hypothesis is raised from ~40% to ~85%.
Residual unknown: whether GPU child-process CommandLine inheritance
exposes a late appendSwitch to subsystems other than Ozone. Not
verified from source; does not change the shipping recommendation.

Related: issue #7270.
2026-04-21 15:03:42 +02:00
..
recurring-events-gap-analysis.md docs: Add recurring events research and implementation plan (#6375) 2026-02-05 15:32:44 +01:00
recurring-events-implementation-plan.md docs: Add recurring events research and implementation plan (#6375) 2026-02-05 15:32:44 +01:00
recurring-events-industry-standards.md docs: Add recurring events research and implementation plan (#6375) 2026-02-05 15:32:44 +01:00
snap-wayland-gpu-fix-research.md docs(research): §18.7 — source-level mechanism for appendSwitch vs argv divergence 2026-04-21 15:03:42 +02:00