Skip to content

fix(macos): keep coordinate-click descendant presses at the click point - #127

Merged
iFurySt merged 3 commits into
iFurySt:mainfrom
hyprcat:fix/coordinate-click-blank-spot
Oct 31, 2026
Merged

iFurySt merged 3 commits into
iFurySt:mainfrom
hyprcat:fix/coordinate-click-blank-spot

Conversation

@hyprcat

@hyprcat hyprcat commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem and fix

Coordinate clicks on blank space could scan the whole window and press an unrelated descendant, including Close. Descendant candidates now require a valid nonempty frame containing the coordinate point, or overlapping the indexed target.

The remaining window-index case is also fixed: clicking the AXWindow index skips descendant and nearby hit searches and uses the existing Raise/focus fallback. Explicit clicks on Close and ordinary buttons remain supported.

Merged current main (74d86db, including #126's coordinate conversion and #139); preserved the original contributor commit.

Validation

  • Swift suite: 402 tests, 9 skipped, 0 failures; documentation and whitespace checks pass.
  • Real locally signed release build, AppKit receiver and native MCP: 1200×864 and 300×216 screenshots, plus AX-only observation. Blank coordinates, an actionless row and window indexes never press unrelated controls or Close. Ordinary indexed/coordinate button clicks and explicit Close are observed by the receiver.
  • The pre-fix(macos): keep coordinate-click descendant presses at the click point #127 signed binary fails the same smoke immediately: a blank click unexpectedly requests Close. The fixture vetoes window closing and counts requests.
  • fix(macos): hit-test click candidates in window points #126's Retina/capped/AX-only hit-test regression remains covered.

Reproduce: node scripts/tests/macos-hit-test-smoke.mjs <signed-ocu-executable> --descendant-guards with existing Accessibility/Screen Recording permissions and runtime admission on an unlocked Retina desktop.

Limits

Tested on one physical Retina display. The completed run used --allow-desktop-activity because the desktop was in use; this skips only foreground/pointer stability assertions, so no stability claim is made for that run. Global pointer fallbacks were disabled. Explicit window Raise may change focus by design. General mouse delivery to actionless custom views is separate from preventing wrong AX actions. Windows/Linux do not use this Swift AX path.

A coordinate click on a blank spot picked the window as its best record
(it has AXRaise), could not press the window itself, then pressed the
smallest pressable descendant anywhere in the window, often the close
button. Descendant scans in performAXClickSequence now only press an
element whose frame contains the click point (coordinate click) or
overlaps the target's click frame (element click, including the nearby
hit-test fallback). With nothing actionable at the point, the click
falls through to the pid-posted mouse event there.

@iFurySt iFurySt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@iFurySt
iFurySt merged commit a432f88 into iFurySt:main Oct 31, 2026
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.

2 participants