Fix macOS capsule monitor targeting#649
Merged
appergb merged 1 commit intoJun 13, 2026
Merged
Conversation
Contributor
PR Reviewer Guide 🔍(Review updated until commit 601c470)Here are some key observations to aid the review process:
|
Collaborator
|
Please resolve the merge conflict.We have just carried out a large-scale reconstruction. |
ad55c9a to
601c470
Compare
Contributor
|
Persistent review updated to latest commit 601c470 |
Contributor
Author
|
Merge conflict has been resolved. I rebased this branch onto the latest |
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
Summary
current_monitor()behavior when macOS AX data is unavailable.Root Cause
The capsule fallback path used
window.current_monitor(), which describes where the capsule window currently lives. When the capsule was hidden or had last appeared on a different display, the layout cache could decide nothing changed and skip moving the capsule to the screen that actually contains the active input field.Validation
npm cinpm run buildnpm run check:macos-capsule-spacesgit diff --checkNot run:
cargo fmt/cargo check --manifest-path openless-all/app/src-tauri/Cargo.tomlbecause this machine does not currently havecargoorrustcinstalled.PR Type
Bug fix, Enhancement
Description
Add macOS focused-input monitor detection via Accessibility API
Use target monitor snapshot for capsule layout caching on macOS
Keep existing Windows path and fallback for other platforms
Diagram Walkthrough
flowchart LR A["Capsule positioning"] --> B{"Platform"} B -- "Windows" --> C["Foreground window monitor"] B -- "macOS" --> D["AX focused input bounds\n→ target monitor"] B -- "Other" --> E["current_monitor()"] C --> F[Set position & cache] D --> F E --> FFile Walkthrough
capsule.rs
Add macOS focused monitor to layout cacheopenless-all/app/src-tauri/src/coordinator/capsule.rs
monitor
lib.rs
Implement macOS AX monitor detectionopenless-all/app/src-tauri/src/lib.rs
frame_distance_to_point_squared