Repository navigation
macOS engine: refuse a shared pointer while another app is in front of a key-focus-only target (#538) - #547
Merged
Merged
Conversation
… main (refs #538) GuardSeam gains a settable key focus and mouse-down kinds beyond the left. KeyFocusOnlyTests drives S (another app frontmost, the target holding key focus, so route 3's activation exits early) through deliverClick and deliverPointer. On 6baf3e3, 4 of its 9 tests fail with 47 assertions: a click, double click, right click, drag and web-area click in S, the front changing before the events, and a pointer joining a never-activated hold are all posted with no hold, leaving the target's window above. The 5 pins (no app frontmost, target frontmost, dedicated mode, the paste's event, and the guarded click and drag with an activation standing) pass on main. Sminos-Session: cursor235#b93055dd (cua on macbook)
…le another app is in front (refs #538) Ruling 1173, option (c). In the key-focus-only state (the target holds window-server key focus, another app is frontmost) activate() exits early and deliver() posted the pointer's events with no hold, repair or watch. Now deliver(), for a pointer with no activation standing, reads the front with frontmostIsTarget as its last step before the events: another app in front throws PointerRefused carrying the readings, and deliverPointer gives the never-run lease back and runs #282's path (the element route where one exists, else keyFocusOnlyRefused). No app frontmost, or the target's, posts alone as before. The meta's pointerRefusal carries reason keyFocusOnly with the frontmost and key-focus pids; the service passes it as cua/pointerRefusal. A joiner of a never-activated entry is refused the same way. Dedicated mode, the paste route (deliver now throws, the paste only adds try), every delivery with an activation standing and #258's carrier are unchanged. Sminos-Session: cursor235#b93055dd (cua on macbook)
…Interfaces' pointerRefusal (refs #538) Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
#538) A cross-app joiner on a shared serving process in both front orders, zero cursor announcements on a refused pointer and on its element route, the front-lost and key-focus-left sentences with no "try again", and set_value's focus fallback carried by the press through focusFieldIfNeeded, focusFallbackClick, focusingClick and deliverClick keeping pointerRefusal. On dfd9303, 5 of the 11 KeyFocusOnlyTests fail with 15 assertions (1 an unexpected throw: B frontmost is wrongly refused), and the focusing chain loses the record. Sminos-Session: cursor235#b93055dd (cua on macbook)
…(refs #538) - P1: deliver() judges the front and key focus for the pointer's own bound app (ranBy's appPid), not the shared entry's, since HeldActivations shares entries by serving process alone. - P2: the agent cursor is announced inside the posting closure, after the refusal, so a refused pointer moves no cursor and an element route after it announces once. - P2: focusingClick copies pointerRefusal back into set_value's and select_text's meta. - P2: the refusal describes the front as read and names what works; it never asks for a retry, which a held never-activated entry would refuse again. - P3: every pointer target its callers build names the bound app (PointerTarget.acceptingFirstMouse(in:)), so a right or middle click's refusal no longer says "the app". Sminos-Session: cursor235#b93055dd (cua on macbook)
…idue (refs #538) Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 23, 2026
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.
Closes #538.
What
The problem state ("S"): the target app holds keyboard focus, another app is frontmost, and no activation is standing. A shared-mode pointer click or drag in S used to post its events with no #200 guard, so it could bring the target's window over the person's. Now it is refused with
PointerRefused(keyFocusOnly:), and the request takes #282's path: the element's own action, or a refusal. Nothing is posted.Rule (c), rulings 1173 and 1174
FakeActivation.deliver(), with no activation standing,frontmostIsTargetis re-read as the last step before posting, after deliver's AX lookups. It judges the pointer's own bound app (ranBy), joiners included._meta.pointerRefusalis{reason: keyFocusOnly, frontmostPid, keyFocusPid, keyFocusIsTarget}. It is carried through the service and through set_value and select_text's focusing fallback.Declared gaps (all ticketed)
Proof
KeyFocusOnlyTests, 12 tests through the real carriers (strict descendant, coordinate, drag, right and middle click). They cover:ValueSettingTests: set_value's real focusing chain in S keepspointerRefusaland is carried by the press.swift test: 1771 tests, 1 skipped, 0 failures. The Xcode 27.2 release build passes.Review
Plugin 0.29.15.
Sminos-Session: cursor235#b93055dd (cua on macbook)