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 c5309b7
Browse filesBrowse the repository at this point in the historyBrowse files
fix(desktop): refuse input when the receiving window cannot be confirmed
Clicks and keys go only to the observed window, or to one of the app's dialogs or
floating panels above it. A missing window attribute is allowed only for menus, and
an unreadable subrole is refused rather than treated as auxiliary.
guardlethit=elementAtPoint(point)else{throwComputerError("window_occluded","Cannot confirm which window receives this point; observe again before retrying.")}
410
410
varowner:pid_t=0
411
411
guardAXUIElementGetPid(hit,&owner)==.success,owner==pidelse{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
413
-
// of its document windows may not.
412
+
// The point must belong to the observed window (its sheets and popovers report it as their window),
413
+
// to one of the app's dialogs or floating panels above it, or to an open menu, which has no window.
/// The element that receives a click at a global point. Notification Center and the Dock keep
422
432
/// full-screen click-through windows above every app, so the topmost window in the window list is not
423
433
/// the click target; Accessibility hit-testing follows the window server's routing. Without an answer
@@ -702,9 +712,7 @@ final class Driver {
702
712
// but never another document window the snapshot did not observe.
703
713
guardletrawWindow=attribute(root,kAXFocusedWindowAttribute),CFGetTypeID(rawWindow)==AXUIElementGetTypeID()else{throwComputerError("focus_failed","The app has no focused window to receive keys; click a window or call activate_app, then observe again.")}
guardobserved||attribute(focusedWindow,kAXSubroleAttribute)as?String!=kAXStandardWindowSubroleelse{throwComputerError("focus_failed","Another document window has keyboard focus; observe that window and target it instead.")}
715
+
guardacceptsInput(focusedWindow,observed:frame.map{[$0]}??Array(snapshot.windowFrames.values))else{throwComputerError("focus_failed","Another document window has keyboard focus; observe that window and target it instead.")}
0 commit comments