Skip to content

Keep the macOS cursor overlay alive at screen edges - #511

Draft
enaboapps wants to merge 1 commit into
mainfrom
agent/macos-overlay-edge-510
Draft

Keep the macOS cursor overlay alive at screen edges#511
enaboapps wants to merge 1 commit into
mainfrom
agent/macos-overlay-edge-510

Conversation

@enaboapps

Copy link
Copy Markdown
Contributor

Closes #510

What changed

  • Preserve existing half-open monitor ownership when a macOS display contains the cursor.
  • Fall back deterministically to the nearest display when the pointer is on an outer edge, corner, or display gap.
  • Keep the marker centered on the real cursor so off-screen portions remain clipped rather than visually offset.
  • Add pure Rust coverage for every outer edge and corner, shared boundaries, negative-coordinate layouts, gaps, ties, and an empty display list.

Root cause

An exact upper or right boundary coordinate matched no NSScreen. The resulting render error terminated the cursor-overlay worker, so moving away from the edge could not restore it.

Validation

  • npm run lint
  • npm test
  • npm run build
  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo test --manifest-path src-tauri/Cargo.toml
  • npm run tauri build -- --bundles app,dmg --no-sign
  • npm run macos:run; stable certificate requirement verified and signed Preview launched

The live pointer edge/corner smoke check is pending because the Mac desktop was locked when Computer Use attempted to inspect the launched app.

@enaboapps

Copy link
Copy Markdown
Contributor Author

@greptileai please review the latest commit 5bc3dbf and provide a full score.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR keeps the macOS cursor overlay worker alive when the pointer does not belong to a display’s half-open frame.

  • Preserves existing half-open ownership for points contained by a display.
  • Selects the nearest display for outer boundaries, corners, and geometric gaps.
  • Adds focused unit coverage for boundaries, negative coordinates, ties, gaps, and an empty display list.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

The new lookup preserves contained-point ownership, deterministically resolves otherwise unmatched coordinates, safely returns None for an empty screen list, and is compatible with the repository’s pinned Rust toolchain.

Important Files Changed

Filename Overview
cross-platform/src-tauri/src/overlay_macos.rs Replaces strict display containment with containment-or-nearest selection and adds comprehensive pure geometry tests; no actionable defect was identified.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Read macOS cursor position] --> B{Point inside a half-open screen frame?}
    B -- Yes --> C[Use containing screen]
    B -- No --> D{Any screens available?}
    D -- No --> E[Return resolution error]
    D -- Yes --> F[Compute squared distance to each frame]
    F --> G[Use nearest screen; first screen wins ties]
    C --> H[Render and position overlay]
    G --> H
Loading

Reviews (1): Last reviewed commit: "Keep macOS overlay alive at screen edges" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep the macOS cursor overlay alive at screen edges

1 participant