From 388bb439d772b675b16cd8e35bf5fe53fb933cd8 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Mon, 1 Dec 2025 18:47:05 +0100 Subject: [PATCH] Improve Linux WebKit fallback configuration Updated the GitHub Actions workflow to simplify package installation for WebKit dependencies on Ubuntu and removed explicit version pinning. Enhanced the Linux WebKit configuration in Rust to apply and log multiple environment variable fallbacks for better handling of EGL issues. --- .github/workflows/tauri-build.yml | 11 +++-------- frontend/src-tauri/src/lib.rs | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index a97d9accc8..4e6047d599 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -89,7 +89,9 @@ jobs: if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get update - sudo apt install \ + sudo apt install -y \ + libwebkit2gtk-4.1-0 \ + libwebkit2gtk-4.1-dev \ build-essential \ curl \ wget \ @@ -99,13 +101,6 @@ jobs: libayatana-appindicator3-dev \ librsvg2-dev \ openjdk-17-jre-headless - sudo apt install -y \ - 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; - name: Setup Node.js uses: actions/setup-node@v4 diff --git a/frontend/src-tauri/src/lib.rs b/frontend/src-tauri/src/lib.rs index ff78d09eb5..9f901e2425 100644 --- a/frontend/src-tauri/src/lib.rs +++ b/frontend/src-tauri/src/lib.rs @@ -31,9 +31,23 @@ use utils::{add_log, get_tauri_logs}; #[cfg(target_os = "linux")] fn configure_linux_webview() { + let mut applied_settings = Vec::new(); + if std::env::var_os("WEBKIT_DISABLE_COMPOSITING_MODE").is_none() { std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1"); - add_log("🛠️ Enabling software rendering for WebKit to avoid EGL issues on Linux".to_string()); + applied_settings.push("WEBKIT_DISABLE_COMPOSITING_MODE=1 (software rendering)"); + } + + if std::env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_none() { + std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); + applied_settings.push("WEBKIT_DISABLE_DMABUF_RENDERER=1 (fallback EGL renderer)"); + } + + if !applied_settings.is_empty() { + add_log(format!( + "🛠️ Applied Linux WebKit fallbacks to avoid EGL issues: {}", + applied_settings.join(", ") + )); } }