fix: restore is_no_compositing_mode useEffect for Linux frost fallback

The useEffect that invokes is_no_compositing_mode was removed along
with StartupShell, but it is the sole trigger for #553/#570's CSS
frost fallback on Linux. Without it, WEBKIT_DISABLE_COMPOSITING_MODE=1
users never get the fallback and see broken frosted glass.

Also fix the dead ternary: isTauri ? 'ready' : 'ready' → 'ready'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
aeoformandClaude Opus 4.7 committed 2026-06-04 22:05:02 +08:00
1 parent a2af260d80
commit 737ca4491e
1 file changed
+14 -1
+14 -1
View File
@@ -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 {
@@ -37,7 +38,7 @@ export function App({ isCapsule, isQa, forcedOs }: AppProps) {
const os = forcedOs ?? detectOS();
// Windows 启动不应被权限探测阻塞首屏。
const [gate, setGate] = useState<Gate>(isTauri ? 'ready' : 'ready');
const [gate, setGate] = useState<Gate>('ready');
useEffect(() => {
if (!isTauri) return;
@@ -168,6 +169,18 @@ export function App({ isCapsule, isQa, forcedOs }: AppProps) {
};
}, [os]);
// Linux: 检测 WEBKIT_DISABLE_COMPOSITING_MODE → 触发磨砂 fallback(#570, #553)
useEffect(() => {
if (!isTauri) return;
invoke<boolean>('is_no_compositing_mode').then((val) => {
if (val) {
document.documentElement.dataset.olNoCompositing = 'true';
}
}).catch((err) => {
console.warn('[startup] is_no_compositing_mode failed', err);
});
}, []);
return (
<HotkeySettingsProvider>
{gate === 'onboarding' ? <Onboarding onComplete={() => setGate('ready')} /> : <FloatingShell os={os} />}