Repository navigation
Pointer: foreground plain click, context menu items in one call, Chromium routed click - #239
Merged
Merged
Conversation
Contributor
Author
|
Live run on this Mac, dev app built from 54f63c3. Chrome 156 ran with a temp profile;
|
…mium routed click - desktop_click foreground true sends a plain single, double or triple click with the real pointer (#225); a background row selection says in its note that it isn't a mouse event. - A right click lists the context menu it opened, and menu_path presses one of its items in the same call, since a background app closes the menu when other input arrives (#227). - In Chromium apps, a point with nothing pressable gets a pointer click routed to the window instead of a refusal (#230). Why: native2/Sources/DesktopMac/Pointer.swift | Chromium exposes AXPress only on elements with their own click listener; pages that delegate clicks at the root (jsaction, frameworks) expose nothing, so a Chromium click with no pressable candidate must fall back to a routed pointer click, which Chromium accepts in the background Why: native2/Sources/DesktopHost/Click.swift | a background app's context menu closes when other input arrives, so items must be pressed in the call that opened it; AXShowMenu blocks while the menu is open, so a menu seen open is a finished delivery
…en that can't be confirmed (#230) A Chrome launched in the background and never activated drops routed left clicks: AppKit discards a mouseDown in a window that isn't key in its app, while Chrome's Accessibility focus names the window either way. The fallback now makes the window key with prepareBackgroundWindow first, refuses when that is refused (nothing sent), and is unknown unless the app then takes itself for active with the window focused. Why: native2/Sources/DesktopMac/Pointer.swift | a routed left click into a Chromium window that isn't key in its app is dropped (right clicks still arrive); AXFocusedWindow can't tell, only the app's own AXFrontmost after prepareBackgroundWindow confirms it
iamnbutler
force-pushed
the
fix-pointer
branch
from
November 3, 2026 02:46
7d54e4c to
fa82837
Compare
Merged
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.
Fixes #225
Fixes #227
Fixes #230
#225: background click isn't a mouse event
Cause. A background single click is an Accessibility press, or, on a list row, an
AXSelectedwrite. The app gets no mouse event, so a selection handler that checksNSApp.currentEvent(the listfix fixture logsevent=other(13)) ignores it, and the result still saidcompleted.Fix.
desktop_clicktakesforeground: truefor a plain single, double or triple click with the real pointer, through the same path as modifier clicks: activate, click, restore pointer and focus, resultunknown. The description says a background single click is an Accessibility press or selection that such apps may ignore, and a background row selection carries anotesaying so. Foreground right and middle clicks are refused, since those are already pointer events.#227: context menu closes before an item can be pressed
Cause. An app in the background closes its context menu as soon as other input arrives, often before the next call.
Fix. A right click now finds the open
AXMenu(the app's children, else the AXMenu in its pop-up-menu-level window) and lists it incontext_menu.items.menu_path(exact titles, asdesktop_menutakes them) presses that item in the same call. A wrong, ambiguous, disabled or submenu title closes the menu withAXCancel, chooses nothing, and returnsunknown(the right click went out) with the titles found. A Paste item is refused while a secure field has focus, asdesktop_menudoes. An AXShowMenu still blocked on its open menu now counts as delivered, so a right click that opened a menu iscompleted, no longerunknown.#230: Chrome clicks refused with "No pressable accessibility element"
Cause. Chromium exposes AXPress only on elements with their own click listener. Pages that listen for clicks once at the root, such as Google's jsaction apps and many frameworks, expose nothing pressable on their rows, links and ⋮ buttons. Reproduced with a local page that delegates clicks: a row by element ID, a row's ⋮ and an email "link" by point were all refused.
Fix. In Chromium apps (
routesThroughSkyLight), when no candidate at the point is pressable, the click is sent as a single pointer click routed to the window (SLEventPostToPid, the route double and right clicks already use). Chromium handles it in the background withisTrustedtrue. The result'snotesays so. Pressable elements are still pressed through Accessibility first. Other apps keep the refusal, which now suggestsforeground: true.Tests
ContextMenuTests(path resolution, item listing, argument refusals).swift test --package-path native2passes.npm run check,npm testandnode scripts/contract.mjs --checkpass.