fix(linux): theme persistence + AppImage EGL crash workaround#36
fix(linux): theme persistence + AppImage EGL crash workaround#36InstaZDLL wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRefactorise ThemeProvider pour lire/écrire la préférence dans localStorage, persister la nouvelle valeur avant basculement, et lancer un "radial reveal" via document.startViewTransition quand disponible. Ajout d'un workaround Linux dans Tauri main() qui définit WEBKIT_DISABLE_DMABUF_RENDERER=1 si absent. ChangesPersistance des thèmes et animations View Transitions
Workaround WebKitGTK (Linux, Tauri)
Sequence DiagramsequenceDiagram
participant Utilisateur
participant ThemeProvider
participant localStorage
participant ViewTransition
participant DocumentElement
Utilisateur->>ThemeProvider: toggleTheme(event)
ThemeProvider->>localStorage: writeStoredTheme(nextIsDark)
alt View Transitions disponibles
ThemeProvider->>ViewTransition: document.startViewTransition()
ViewTransition->>ThemeProvider: transition.ready
ThemeProvider->>ThemeProvider: setIsDark(nextIsDark)
ThemeProvider->>DocumentElement: documentElement.animate(clipPath radial)
else non supporté
ThemeProvider->>ThemeProvider: setIsDark(nextIsDark) (instantané)
end
Estimated code review effort🎯 4 (Complexe) | ⏱️ ~40 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
AppImage builds abort with `Could not create default EGL display: EGL_BAD_PARAMETER` on multiple distros (Ubuntu 22, Fedora 44, Arch/CachyOS/EndeavourOS) and inside VMware. WebKitGTK >= 2.42 uses the DMA-BUF renderer by default, which fails to negotiate a display in the bundled AppImage environment. Set the documented workaround env var at the very top of main() before any GTK/EGL init.
Two Linux fixes bundled together — both surface as "app appears broken on Linux" from a user POV.
1. AppImage EGL crash on startup
Symptom: AppImage built on Ubuntu 22 LTS aborts on every distro tested (Ubuntu 22, CachyOS, EndeavourOS, Fedora 44) and inside VMware with:
Root cause: WebKitGTK ≥ 2.42 enables its DMA-BUF renderer by default, which fails to negotiate an EGL display in the bundled AppImage environment (mismatched Mesa/EGL libs, VM software rasterizer, certain NVIDIA setups).
Fix: Set
WEBKIT_DISABLE_DMABUF_RENDERER=1at the very top ofmain(), before any GTK/EGL init. Only set if not already provided so power-users can still override.2. Dark-mode toggle crash (#34)
Symptom: On CachyOS + KDE Plasma Wayland + NVIDIA, clicking the dark-mode toggle freezes the webview ("not responding" dialog).
Root cause: WebKitGTK's View Transitions implementation crashes inside the compositor on some GPU/Wayland stacks. We can't reliably feature-detect which builds are buggy, and gating on
userAgent.includes("linux")would kill the animation for every Linux user.Fix: Persist the next theme value to
localStoragebefore callingstartViewTransition. The animation still runs everywhere (no regression for Windows/macOS, Debian, Fedora, healthy Arch setups). If the webview crashes during the transition on the bad stack, the next launch picks up the new theme. Bonus: dark mode now persists across restarts everywhere (previouslyuseState(false)reset on every launch).Closes #34
Test plan
WEBKIT_DISABLE_DMABUF_RENDERER=0keeps the new rendererSummary by CodeRabbit
Notes de version
Corrections de bugs
Améliorations