diff --git a/openless-all/app/src-tauri/src/commands.rs b/openless-all/app/src-tauri/src/commands.rs index da2df0b2..a31cbb1d 100644 --- a/openless-all/app/src-tauri/src/commands.rs +++ b/openless-all/app/src-tauri/src/commands.rs @@ -3523,6 +3523,12 @@ pub async fn github_device_flow_poll( Ok(GithubDevicePollResult::Error { message: msg }) } +#[tauri::command] +pub fn is_no_compositing_mode() -> bool { + // Linux WebKitGTK: WEBKIT_DISABLE_COMPOSITING_MODE=1 时 backdrop-filter 不可用 + std::env::var("WEBKIT_DISABLE_COMPOSITING_MODE").as_deref() == Ok("1") +} + #[cfg(test)] mod tests { use super::{ diff --git a/openless-all/app/src-tauri/src/lib.rs b/openless-all/app/src-tauri/src/lib.rs index 8b808a61..719a2e31 100644 --- a/openless-all/app/src-tauri/src/lib.rs +++ b/openless-all/app/src-tauri/src/lib.rs @@ -465,6 +465,7 @@ pub fn run() { #[cfg(target_os = "windows")] commands::sherpa_onnx_asr_reveal_model_dir, commands::export_error_log, + commands::is_no_compositing_mode, restart_app, ]) .build(tauri::generate_context!()) diff --git a/openless-all/app/src/App.tsx b/openless-all/app/src/App.tsx index c2b5402b..c3eb54f5 100644 --- a/openless-all/app/src/App.tsx +++ b/openless-all/app/src/App.tsx @@ -17,6 +17,7 @@ import { windowMouseHotkeyCode, } from './lib/windowHotkeyFallback'; import { QaPanel } from './pages/QaPanel'; +import { invoke } from '@tauri-apps/api/core'; import { HotkeySettingsProvider } from './state/HotkeySettingsContext'; interface AppProps { @@ -169,6 +170,18 @@ export function App({ isCapsule, isQa, forcedOs }: AppProps) { }; }, [os]); + // Linux: 检测 WEBKIT_DISABLE_COMPOSITING_MODE → 禁用 backdrop-filter fallback + useEffect(() => { + if (!isTauri) return; + invoke('is_no_compositing_mode').then((val) => { + if (val) { + document.documentElement.dataset.olNoCompositing = 'true'; + } + }).catch((err) => { + console.warn('[startup] is_no_compositing_mode failed', err); + }); + }, []); + if (gate === 'checking') { return ; } diff --git a/openless-all/app/src/components/FloatingShell.tsx b/openless-all/app/src/components/FloatingShell.tsx index 532b91c0..96a99d09 100644 --- a/openless-all/app/src/components/FloatingShell.tsx +++ b/openless-all/app/src/components/FloatingShell.tsx @@ -324,6 +324,7 @@ function FloatingShellBody({ os, initialTab, initialSettings }: { os: OS; initia 一起坐在 WindowChrome 的磨砂底板上,整体一块连续玻璃。 */}