mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-05 21:19:08 +02:00
[client/ui] Disable WebKit compositing on Linux to avoid Intel/Mesa SIGSEGV
WebKitGTK's accelerated GL compositor crashes with a SIGSEGV inside g_application_run on some Intel setups, hitting Mesa anv/i965 code paths for DRM format modifiers that aren't implemented (FINISHME: YUV colorspace / multi-planar formats). Disabling the DMA-BUF renderer alone doesn't cover the GL compositor, so the crash survived that workaround. Set WEBKIT_DISABLE_COMPOSITING_MODE=1 in init() (skipped if the user already set it) to force CPU rendering, which is fine for a UI this small and sidesteps the broken modifier path.
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
// init runs before Wails' own init(), so the env vars are set in time.
|
||||
func init() {
|
||||
disableDMABUFRenderer()
|
||||
disableCompositingMode()
|
||||
disableWebKitSandboxIfNeeded()
|
||||
}
|
||||
|
||||
@@ -26,6 +27,23 @@ func disableDMABUFRenderer() {
|
||||
_ = os.Setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "1")
|
||||
}
|
||||
|
||||
// disableCompositingMode turns off WebKitGTK's accelerated (GL) compositing
|
||||
// path. Disabling the DMA-BUF renderer alone is not enough on some Intel
|
||||
// setups: WebKitGTK 2.52 still drives the GPU through the GL compositor, and
|
||||
// Mesa's anv/i965 hits unimplemented DRM-format-modifier code paths
|
||||
// ("FINISHME: support YUV colorspace with DRM format modifiers" /
|
||||
// "...multi-planar formats...") that crash with a SIGSEGV inside
|
||||
// g_application_run before the first frame paints. Forcing compositing off
|
||||
// makes WebKit render on the CPU, which is fine for a small UI like this and
|
||||
// sidesteps the broken modifier path. The user can re-enable it by setting
|
||||
// WEBKIT_DISABLE_COMPOSITING_MODE themselves (e.g. to "0").
|
||||
func disableCompositingMode() {
|
||||
if os.Getenv("WEBKIT_DISABLE_COMPOSITING_MODE") != "" {
|
||||
return
|
||||
}
|
||||
_ = os.Setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1")
|
||||
}
|
||||
|
||||
// disableWebKitSandboxIfNeeded works around WebKitGTK crashing at startup when
|
||||
// its bubblewrap (bwrap) sandbox can't create an unprivileged user namespace —
|
||||
// "bwrap: setting up uid map: Permission denied" followed by "Failed to fully
|
||||
|
||||
Reference in New Issue
Block a user