Feature/multi screen follow#956
Open
xuebkgithub wants to merge 2 commits intoayangweb:masterfrom
Open
Conversation
macOS 主窗口由 NSPanel 创建,CollectionBehavior 含 .stationary(), 导致面板被钉死在创建时所在屏幕,多显示器用户无法把猫咪带到当前工作的屏幕。 - 偏好设置「通用 → 应用设置」新增「跟随当前屏幕」开关,仅 macOS 显示, 默认关闭,行为保持现状 - Rust 端新增 set_multi_screen_follow command,使用 AtomicBool 共享开关状态, show/hide 路径同步读取;开启时去掉 .stationary() 让 NSPanel 可跨 Space/屏幕 - 新增 useMultiScreenFollow composable,开关启用时 800ms 轮询 cursorPosition + monitorFromPoint,按相对偏移把窗口平移到鼠标所在显示器 并裁剪到边界 - Windows / Linux 端提供同名 no-op,保持 generate_handler! 跨平台符号一致 - 5 个 locale (en-US / zh-CN / zh-TW / pt-BR / vi-VN) 全量补齐文案 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
大屏 → 小屏切换时跨屏跟随会被裁剪到小屏边界,回到大屏后 之前用户手动设定的位置就会丢失。 - 新增 monitorOffsets Map,按屏幕 (x,y,w,h) 作为 key - 每次轮询同步当前屏幕的最新偏移,捕获用户屏内拖动 - 跨屏移动时优先使用目标屏幕的历史偏移,无记录再用源屏偏移 - 关闭开关时清空 Map,避免状态残留 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
macOS 主窗口由 NSPanel 创建,
CollectionBehavior含.stationary(),导致面板被钉死在创建时所在屏幕,多显示器用户无法把猫咪带到当前工作的屏幕。本 PR 在「偏好设置 → 通用 → 应用设置」新增「跟随当前屏幕」开关(仅 macOS 显示,默认关闭,行为保持现状)。开启后,BongoCat 会自动跟随鼠标所在显示器,并按相对偏移落位、记忆每屏位置。
变更要点
macOS 行为
set_multi_screen_followcommand,使用AtomicBool共享开关状态,show/hide路径同步读取.stationary()让 NSPanel 可跨 Space / 屏幕前端跟随逻辑
useMultiScreenFollowcomposable,开关启用时以 800ms 间隔轮询cursorPosition+monitorFromPointmonitorOffsetsMap(key =x,y,w,h),记忆每个屏幕上窗口的最近停留位置:跨平台
generate_handler!跨平台符号一致国际化
Test plan