From 2ca784caafde3010a8abd591889a3b8021870e07 Mon Sep 17 00:00:00 2001 From: Elie Habib Date: Thu, 26 Feb 2026 16:39:08 +0400 Subject: [PATCH] fix(linux): address AppImage black screen on WebKit/GStreamer --- .github/workflows/build-desktop.yml | 8 +++++++- src-tauri/src/main.rs | 8 +++++++- src-tauri/tauri.conf.json | 5 +++++ src-tauri/tauri.finance.conf.json | 5 +++++ src-tauri/tauri.tech.conf.json | 5 +++++ 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index 3c35dc1bb..cbb8140a7 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -89,7 +89,13 @@ jobs: if: contains(matrix.platform, 'ubuntu') run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + sudo apt-get install -y \ + libwebkit2gtk-4.1-dev \ + libappindicator3-dev \ + librsvg2-dev \ + patchelf \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good - name: Install frontend dependencies run: npm ci diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 37d3e23c4..6d51fcd23 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1161,9 +1161,15 @@ fn main() { } // WebKit2GTK's bubblewrap sandbox can fail inside an AppImage FUSE - // mount, causing blank white screens. Disable it when running as + // mount, causing blank white screens. Disable it when running as // AppImage — the AppImage itself already provides isolation. if env::var_os("APPIMAGE").is_some() { + // WebKitGTK 2.39.3+ deprecated WEBKIT_FORCE_SANDBOX and now expects + // WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 instead. + if env::var_os("WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS").is_none() { + unsafe { env::set_var("WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS", "1") }; + } + // Keep the legacy var for older WebKitGTK releases that still use it. if env::var_os("WEBKIT_FORCE_SANDBOX").is_none() { unsafe { env::set_var("WEBKIT_FORCE_SANDBOX", "0") }; } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 020b11e24..b79378e14 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -65,6 +65,11 @@ }, "macOS": { "hardenedRuntime": true + }, + "linux": { + "appimage": { + "bundleMediaFramework": true + } } } } diff --git a/src-tauri/tauri.finance.conf.json b/src-tauri/tauri.finance.conf.json index 7ac72b391..f386729a4 100644 --- a/src-tauri/tauri.finance.conf.json +++ b/src-tauri/tauri.finance.conf.json @@ -23,6 +23,11 @@ "macOS": { "hardenedRuntime": true }, + "linux": { + "appimage": { + "bundleMediaFramework": true + } + }, "windows": { "digestAlgorithm": "sha256", "timestampUrl": "https://timestamp.digicert.com" diff --git a/src-tauri/tauri.tech.conf.json b/src-tauri/tauri.tech.conf.json index cb79b45f1..8a858fb68 100644 --- a/src-tauri/tauri.tech.conf.json +++ b/src-tauri/tauri.tech.conf.json @@ -23,6 +23,11 @@ "macOS": { "hardenedRuntime": true }, + "linux": { + "appimage": { + "bundleMediaFramework": true + } + }, "windows": { "digestAlgorithm": "sha256", "timestampUrl": "https://timestamp.digicert.com"