mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
Defense-in-depth against GPU init failures on Snap/Flatpak Linux where the main process stays alive but the GPU process crashes at init and the window never renders. Field data in #7270 (two post-v18.2.4 reports) shows this happens on Ubuntu 24.04+/25.10 regardless of GPU vendor — the driver is core22 Mesa/libgbm drifted from the host Mesa. See §12–§17 in docs/research/snap-wayland-gpu-fix-research.md. Mechanism (electron/gpu-startup-guard.ts): - Content-based crash marker in userData with {ts, electronVersion}. Written before app.whenReady() on confined Linux; cleared via IPC.APP_READY after Angular boot — not ready-to-show, which fires on blank/broken renderers too. - Previous-crash detection: marker present AND recent (<5 min) AND matching Electron version. Staleness bound + version gating drop systemd-SIGKILL-mid-boot and post-upgrade-residue false-negatives. - Env overrides SP_DISABLE_GPU=1 / SP_ENABLE_GPU=1 work on all platforms; auto-detection is Linux+Snap/Flatpak-only. - Non-ENOENT fs errors logged at warn — a swallowed write-fail previously meant the guard could re-enter the loop with no diagnostic trail; a swallowed unlink-fail meant a successful boot could get permanently stuck in crash-recovery. Fallback flag bundle (start-app.ts): --disable-gpu --disable-software-rasterizer --ozone-platform=x11 The pair matches Chromium's GPU integration tests' "no GPU process" invariant; DisplayCompositor handles 2D in the browser process without spawning a GPU child. app.disableHardwareAcceleration() alone does NOT — verified against electron/electron#17180/#20702. The extra --ozone-platform=x11 closes the Chromium 140+ browser-side Wayland/libgbm-dlopen gap on Flatpak (redundant with the existing Snap X11 widening branch; last flag wins). Novelty: R3 survey of VS Code, Slack, Insomnia, LosslessCut, Obsidian flatpak, Firefox snap, and Canonical's gpu-2404-wrapper found no peer Electron-snap implementing an equivalent reactive crash-detection + auto-fallback. Prevailing patterns are manual --ozone-platform=x11, proactive env-sniff, or do-nothing. Review: §14–§15 multi-agent verification on the original PR #7273; re-reviewed via 7-agent multi-review (6 Claude focus-agents + Codex CLI) + 5 research agents here (§17). Live-tested with SP_DISABLE_GPU=1 on a KDE/X11 dev host — window rendered normally via DisplayCompositor. Refs: #7270 |
||
|---|---|---|
| .. | ||
| assets/icons | ||
| ipc-handlers | ||
| scripts | ||
| shared-with-frontend | ||
| task-widget | ||
| backup.ts | ||
| clear-stale-idb-locks.ts | ||
| clipboard-image-handler.ts | ||
| common.const.ts | ||
| CONFIG.ts | ||
| debug.ts | ||
| electronAPI.d.ts | ||
| error-handler-with-frontend-inform.ts | ||
| full-screen-blocker.ts | ||
| gpu-startup-guard.ts | ||
| idle-time-handler.ts | ||
| indicator.ts | ||
| ipc-handler-wrapper.ts | ||
| ipc-handler.ts | ||
| jira.ts | ||
| local-file-sync.ts | ||
| local-rest-api.ts | ||
| lockscreen.ts | ||
| main-window.ts | ||
| main.ts | ||
| plugin-node-executor.ts | ||
| plugin-oauth.ts | ||
| preload.ts | ||
| protocol-handler.ts | ||
| proxy-agent.ts | ||
| shared-state.ts | ||
| simple-store.ts | ||
| start-app.ts | ||
| tsconfig.electron.json | ||
| various-shared.ts | ||