Description
Context
On some Linux GPU/compositor combinations (mainly NVIDIA + Wayland), WebKitGTK's default DMA-BUF renderer fails, crashing Defguard Client on launch with:
Gdk-Message: Error 71 (Protocol error) dispatching to Wayland display.
Users currently must manually set WEBKIT_DISABLE_DMABUF_RENDERER=1. Documented by Tauri: https://v2.tauri.app/develop/debug/linux-graphics/
Goal
Detect affected configurations automatically and apply the least invasive fix - without disabling acceleration for unaffected users.
Approach
Do not set the workaround unconditionally for everyone (per Tauri's own guidance - it removes the faster rendering path for users on working setups).
At startup, before webview init:
- Detect Wayland session (
XDG_SESSION_TYPE / WAYLAND_DISPLAY) and NVIDIA driver presence.
- Skip if the user already set
WEBKIT_DISABLE_DMABUF_RENDERER or __NV_DISABLE_EXPLICIT_SYNC manually.
- If affected: try
__NV_DISABLE_EXPLICIT_SYNC=1 first (keeps acceleration). Fall back to WEBKIT_DISABLE_DMABUF_RENDERER=1 only if that's insufficient.
- Log which decision was made and why.
Alternative/complementary: apply the fix in the package post-install script by patching the .desktop file's Exec line, rather than system-wide.
Acceptance criteria
Risks
- NVIDIA driver presence ≠ guaranteed failure (545+ often works fine) - consider checking driver version to avoid unnecessary workarounds.
Description
Context
On some Linux GPU/compositor combinations (mainly NVIDIA + Wayland), WebKitGTK's default DMA-BUF renderer fails, crashing Defguard Client on launch with:
Users currently must manually set
WEBKIT_DISABLE_DMABUF_RENDERER=1. Documented by Tauri: https://v2.tauri.app/develop/debug/linux-graphics/Goal
Detect affected configurations automatically and apply the least invasive fix - without disabling acceleration for unaffected users.
Approach
Do not set the workaround unconditionally for everyone (per Tauri's own guidance - it removes the faster rendering path for users on working setups).
At startup, before webview init:
XDG_SESSION_TYPE/WAYLAND_DISPLAY) and NVIDIA driver presence.WEBKIT_DISABLE_DMABUF_RENDERERor__NV_DISABLE_EXPLICIT_SYNCmanually.__NV_DISABLE_EXPLICIT_SYNC=1first (keeps acceleration). Fall back toWEBKIT_DISABLE_DMABUF_RENDERER=1only if that's insufficient.Alternative/complementary: apply the fix in the package post-install script by patching the
.desktopfile'sExecline, rather than system-wide.Acceptance criteria
__NV_DISABLE_EXPLICIT_SYNC=1beforeWEBKIT_DISABLE_DMABUF_RENDERER=1.Risks