fix(capsule): 入场帧强制重注册 Space 贴附——胶囊不再被 macOS 26 钉死在单个桌面 - #875
Merged
Conversation
Contributor
PR Reviewer Guide 🔍(Review updated until commit bd63cbe)Here are some key observations to aid the review process:
|
实测(2026-07-31):macOS 26 会在运行中把胶囊窗口从「全 Space 贴附」剥离, 之后它表现为普通受管窗口:只在某一个桌面可见,其它桌面上听写全程无任何 UI 指示(后端 30Hz orderFrontRegardless 全部无效,窗口 onscreen=0,最长观测 到 78 秒无提示录音)。用户侧症状即「微信里不弹胶囊、Claude 里又有」—— 实际按桌面分,不按 App 分。 CGS 取证 + 体外复现(CGSRemoveWindowsFromSpaces 人工制造同款坏状态)跑遍 四种救法,结论: · 重写同值 273:无效(AppKit 同值写入是 no-op,这正是坏状态救不回的原因) · 隐藏时翻转 0→273 再显示:无效(隐藏期间的值变化不触发重注册) · 同一 tick 连写 0、273:无效(被合并) · 窗口可见时发生 CanJoinAllSpaces 位 0→1 的转变:有效,完整恢复贴附 · 跨显示器移动:有效(与野外观察到的「外接屏上意外自愈」一致) 修法:入场帧(隐藏→可见)先以 272(保留 Stationary|FullScreenAuxiliary,仅去 CanJoinAllSpaces 位)上屏,30ms 后的下一个主线程 tick 写回 273——可见状态下 的位翻转强制 WindowServer 重新注册贴附。30Hz level 帧不参与。写前读当前值, 发现漂移打 warn 留证据。glow 窗口同款写法一并加固。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bigsongeth
force-pushed
the
fix/capsule-space-reassert
branch
from
July 31, 2026 14:58
7634322 to
bd63cbe
Compare
Contributor
|
Persistent review updated to latest commit bd63cbe |
Contributor
|
Persistent review updated to latest commit bd63cbe |
3 tasks
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
症状
用户报告「微信里不弹录音胶囊、Claude 里又有」。实测按**桌面(Space)**分而不按 App 分:胶囊被钉死在某一个桌面,用户在其它桌面听写时,麦克风开着却没有任何 UI 指示(最长观测到 78 秒无提示录音)。
取证(2026-07-31,macOS 26 / Darwin 25.5)
orderFrontRegardless,CGWindowList 显示窗口位置/level 全对,但onscreen=0贯穿全程;CGSCopySpacesForWindows:坏状态胶囊spaces=[3](应为[3,5]);重启 App 恢复;CGSRemoveWindowsFromSpaces对同款设置的测试窗口人工制造相同坏状态(值仍 273、注册残缺),然后跑遍救法:结论:macOS 26 上贴附注册只在「窗口可见时 CanJoinAllSpaces 位发生真实转变」时刷新;AppKit 同值写入是 no-op——这就是坏状态一旦出现便不可恢复(除重启)的机制。剥离的野生触发点未定位(拔/插显示器、新建桌面均实测良性),但修复不依赖触发点。
修法
验证
cargo check通过(仅存量 warning);🤖 Generated with Claude Code
PR Type
Bug fix
Description
Fix macOS 26 Space pinning of capsule window
Reassert Spaces registration on entry frame
Flip CanJoinAllSpaces only while window visible
Mirror fix in glow window and log drift
Diagram Walkthrough
File Walkthrough
coordinator.rs
Plumb reassert-spaces flag through capsule show pathopenless-all/app/src-tauri/src/coordinator.rs
reassert_spacesparameter toshow_capsule_window_for_recordingcapsule_focus.rs
Reassert macOS Spaces attachment via visible bit flipopenless-all/app/src-tauri/src/coordinator/capsule_focus.rs
CanJoinAllSpaces,Stationary, andFullScreenAuxiliaryCanJoinAllSpaces) beforeorderFrontRegardlesslib.rs
Apply Spaces reassert sequence to glow windowopenless-all/app/src-tauri/src/lib.rs
orderFrontRegardless, then schedules the 273 write