fix(linux): fallback from backdrop-filter when WEBKIT_DISABLE_COMPOSITING_MODE=1#570
Merged
Merged
Conversation
…TING_MODE=1 Issue Open-Less#553: Linux 上 WEBKIT_DISABLE_COMPOSITING_MODE=1 时 WebKitGTK backdrop-filter 在 DOM 重排后失效(hover 历史词汇表 / 选择条目刷新面板)。 方案: - Rust 端新增 is_no_compositing_mode command 暴露环境变量状态 - App.tsx 初始化时调用,写入 data-ol-no-compositing 到 <html> - CSS 用 [data-ol-no-compositing] 选择器覆盖 inline style,切换到 渐变+噪点纹理假磨砂方案(复用 tokens.css --ol-frost-grain) - WindowChrome/FloatingShell 加 className 钩子 受影响的三处 backdrop-filter:WindowChrome 底板、主面板、 Linux 标题栏。ProviderPrompt/HotkeyModePrompt 弹窗遮罩 (瞬态 UI)跳过。提交签署:Reasonix Code
Closed
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Closes #553
问题
Linux 上
WEBKIT_DISABLE_COMPOSITING_MODE=1(由main.rs设置,用于修复 tauri#9394 窗口点击无响应)会禁用 WebKitGTK 合成层,导致 CSSbackdrop-filter在 DOM 重排后失效。具体表现:方案
前端初始化时通过 Tauri command 探测环境变量,检测到
WEBKIT_DISABLE_COMPOSITING_MODE=1时用 CSS 数据属性切换三处backdrop-filter到渐变+噪点纹理的假磨砂方案:<main>文件改动
src-tauri/src/commands.rsis_no_compositing_modecommandsrc-tauri/src/lib.rssrc/App.tsxdata-ol-no-compositingsrc/styles/global.css!important回退规则(带isolation: isolate)src/components/WindowChrome.tsxol-winchrome/ol-linux-titlebarclasssrc/components/FloatingShell.tsx<main>加ol-console-mainclass验证
cargo check✅tsc --noEmit✅测试
需要 Linux 用户拉本地编译验证。
PR Type
Bug fix, Enhancement
Description
Add Rust command to detect WEBKIT_DISABLE_COMPOSITING_MODE
Frontend sets data attribute on startup
CSS fallback replaces backdrop-filter with gradient + noise texture
Add class hooks to WindowChrome and FloatingShell components
Diagram Walkthrough
File Walkthrough
commands.rs
Add command to detect compositing modeopenless-all/app/src-tauri/src/commands.rs
is_no_compositing_modecommand returning boolWEBKIT_DISABLE_COMPOSITING_MODEenv varApp.tsx
Initialize compositing detection on loadopenless-all/app/src/App.tsx
invokedata-ol-no-compositingon document element when trueFloatingShell.tsx
Add class to main console areaopenless-all/app/src/components/FloatingShell.tsx
ol-console-mainto<main>elementWindowChrome.tsx
Add class hooks for CSS fallbackopenless-all/app/src/components/WindowChrome.tsx
ol-winchrometo outer containerol-linux-titlebarto Linux titlebarlib.rs
Register new Tauri commandopenless-all/app/src-tauri/src/lib.rs
is_no_compositing_modecommandglobal.css
Add CSS fallback for no-compositing modeopenless-all/app/src/styles/global.css
data-ol-no-compositing