fix(appimage): pin WebKitGTK to 2.44.0-2 to prevent EGL crash

The AppImage EGL_BAD_PARAMETER crash is caused by how Tauri's
linuxdeploy bundles newer WebKitGTK versions (tauri-apps/tauri#11994).

Fix: pin WebKitGTK to 2.44.0-2 on ubuntu-24.04, matching the proven
fix from other Tauri apps (audioling#40, OmniKee).

Also revert runtime env var workarounds (LIBGL_ALWAYS_SOFTWARE,
default-off hardware accel) since the fix is at the build level.
Keep only the NVIDIA DMA-BUF workaround which is still needed.
This commit is contained in:
vicrodh committed 2026-02-09 01:28:11 -06:00
1 parent 52f2d9ded5
commit ddf4142188
3 files changed
+38 -30

No files matched your search

+8 -1
View File
@@ -47,8 +47,15 @@ jobs:
- name: Install system dependencies - name: Install system dependencies
run: | run: |
sudo apt-get update sudo apt-get update
# Pin WebKitGTK to 2.44.0-2 to prevent EGL_BAD_PARAMETER crash in AppImage
# See: https://github.com/tauri-apps/tauri/issues/11994
sudo apt-get install -y \ sudo apt-get install -y \
libwebkit2gtk-4.1-dev \ libwebkit2gtk-4.1-0=2.44.0-2 \
libwebkit2gtk-4.1-dev=2.44.0-2 \
libjavascriptcoregtk-4.1-0=2.44.0-2 \
libjavascriptcoregtk-4.1-dev=2.44.0-2 \
gir1.2-javascriptcoregtk-4.1=2.44.0-2 \
gir1.2-webkit2-4.1=2.44.0-2 \
libgtk-3-dev \ libgtk-3-dev \
libappindicator3-dev \ libappindicator3-dev \
librsvg2-dev \ librsvg2-dev \
+9 -2
View File
@@ -13,7 +13,7 @@ on:
jobs: jobs:
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-24.04
permissions: permissions:
contents: write contents: write
steps: steps:
@@ -80,8 +80,15 @@ jobs:
- name: Install system dependencies - name: Install system dependencies
run: | run: |
sudo apt-get update sudo apt-get update
# Pin WebKitGTK to 2.44.0-2 to prevent EGL_BAD_PARAMETER crash in AppImage
# See: https://github.com/tauri-apps/tauri/issues/11994
sudo apt-get install -y \ sudo apt-get install -y \
libwebkit2gtk-4.1-dev \ libwebkit2gtk-4.1-0=2.44.0-2 \
libwebkit2gtk-4.1-dev=2.44.0-2 \
libjavascriptcoregtk-4.1-0=2.44.0-2 \
libjavascriptcoregtk-4.1-dev=2.44.0-2 \
gir1.2-javascriptcoregtk-4.1=2.44.0-2 \
gir1.2-webkit2-4.1=2.44.0-2 \
libgtk-3-dev \ libgtk-3-dev \
libappindicator3-dev \ libappindicator3-dev \
librsvg2-dev \ librsvg2-dev \
+21 -27
View File
@@ -55,10 +55,12 @@ fn main() {
// Wayland and WebKit compatibility fixes for Linux // Wayland and WebKit compatibility fixes for Linux
// Addresses: https://github.com/vicrodh/qbz/issues/6 // Addresses: https://github.com/vicrodh/qbz/issues/6
// //
// WebKit's EGL/DMA-BUF renderer crashes on many GPU/driver/compositor // The primary EGL crash ("Could not create default EGL display") in
// combinations with "Could not create default EGL display" or fatal // AppImage is fixed at the build level by pinning WebKitGTK to 2.44.0-2
// protocol errors (Error 71). Hardware acceleration is disabled by // in the CI workflow (see tauri-apps/tauri#11994).
// default and can be opted into with QBZ_HARDWARE_ACCEL=1. //
// Runtime workarounds below handle NVIDIA DMA-BUF issues and provide
// escape hatches for edge cases.
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
{ {
let is_wayland = std::env::var_os("WAYLAND_DISPLAY").is_some() let is_wayland = std::env::var_os("WAYLAND_DISPLAY").is_some()
@@ -66,7 +68,8 @@ fn main() {
let has_nvidia = is_nvidia_gpu(); let has_nvidia = is_nvidia_gpu();
// User overrides // User overrides
let hardware_accel = std::env::var("QBZ_HARDWARE_ACCEL").as_deref() == Ok("1"); let force_dmabuf = std::env::var("QBZ_FORCE_DMABUF").as_deref() == Ok("1");
let disable_dmabuf = std::env::var("QBZ_DISABLE_DMABUF").as_deref() == Ok("1");
let force_x11 = std::env::var("QBZ_FORCE_X11").as_deref() == Ok("1"); let force_x11 = std::env::var("QBZ_FORCE_X11").as_deref() == Ok("1");
// Diagnostic logging // Diagnostic logging
@@ -85,29 +88,20 @@ fn main() {
std::env::set_var("GTK_CSD", "1"); std::env::set_var("GTK_CSD", "1");
} }
// Hardware acceleration control // DMA-BUF renderer control
// Default: OFF for all GPUs (EGL crashes on too many configurations) // NVIDIA GPUs have known issues with WebKit's DMA-BUF renderer on
// Opt-in: QBZ_HARDWARE_ACCEL=1 // Wayland, causing fatal protocol errors (Error 71).
// if force_dmabuf {
// WEBKIT_DISABLE_DMABUF_RENDERER alone is NOT enough — WebKit still eprintln!("[QBZ] User override: DMA-BUF renderer forced ON");
// tries eglGetDisplay() for compositing and crashes with } else if disable_dmabuf {
// "Could not create default EGL display: EGL_BAD_PARAMETER" on systems eprintln!("[QBZ] User override: DMA-BUF renderer forced OFF");
// without working EGL (VMs, some driver combos). std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
// LIBGL_ALWAYS_SOFTWARE forces Mesa to use llvmpipe so EGL init } else if has_nvidia {
// succeeds through software rasterization instead of crashing. eprintln!("[QBZ] NVIDIA GPU: disabling WebKit DMA-BUF renderer");
if hardware_accel { eprintln!("[QBZ] To override: set QBZ_FORCE_DMABUF=1");
eprintln!("[QBZ] Hardware acceleration enabled (QBZ_HARDWARE_ACCEL=1)"); std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
if has_nvidia && is_wayland {
eprintln!("[QBZ] Warning: NVIDIA + Wayland may cause crashes with hardware acceleration");
}
} else { } else {
eprintln!("[QBZ] Hardware acceleration disabled (default). Set QBZ_HARDWARE_ACCEL=1 to enable"); eprintln!("[QBZ] Using default WebKit renderer (hardware accelerated)");
if std::env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_none() {
std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
}
if std::env::var_os("LIBGL_ALWAYS_SOFTWARE").is_none() {
std::env::set_var("LIBGL_ALWAYS_SOFTWARE", "1");
}
} }
} }