You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c4fae2b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(desktop): confirm the click window and the highlighted menu item before input
- A coordinate click must land in the observed window, or in a sheet, popover,
panel or menu above it; another document window of the same app is refused
- The menu-completion Return is sent only when the pressed item reports itself
highlighted
guardNSWorkspace.shared.frontmostApplication?.processIdentifier == pid else{throwComputerError("foreground_required","Coordinate mouse input requires the target app in front. Call activate_app, then observe again.")}
406
408
guardtrywindowRect(windowID, pid: pid)== frame else{throwComputerError("stale_window","Window moved during input; observe it again.")}
407
-
guardlet owner =pointOwner(point), owner == pid else{throwComputerError("window_occluded","The target point is covered by another app's window; bring the intended window forward and observe again.")}
409
+
guardlet hit =elementAtPoint(point)else{throwComputerError("window_occluded","Cannot confirm which window receives this point; observe again before retrying.")}
410
+
varowner:pid_t=0
411
+
guardAXUIElementGetPid(hit,&owner)==.success, owner == pid else{throwComputerError("window_occluded","The target point is covered by another app's window; bring the intended window forward and observe again.")}
412
+
// The app's own sheets, popovers, panels and menus may sit above the observed window; another
0 commit comments