Skip to content

macOS engine: a click in the key-focus-only state is posted with no activation and may be dropped with no #282 refusal #541

Backlog

Description

@SSFSKIM

Problem

In state S (the target holds window-server key focus but isn't frontmost), activate() exits early, so the click is posted with no activation. After #538's (b) it is guarded for window order, but in an app that isn't active a view that refuses first mouse may drop it, and the engine still answers success. #282's refusal (no usable activation point) doesn't apply, because no activation is planned. This is on main today.

Fix direction

Decide from #538's hosted qualification probe, which reports whether the click is delivered in S. If clicks are dropped and subtype 1/2 is harmless there, take option (a2) from the note: key focus alone doesn't count as focused for pointers, so the ordinary background path, with #282's refusal and #321's hold, applies.

From #538's design note (/Users/new/.local/share/187/design-538.md), ruling 1172.

Update (ruling 1173): #538 refuses in S; a guarded delivery in S is designed here

#538 now refuses shared pointer delivery in S (keyFocusOnly, nothing posted). If #538's hosted probe shows S is common and the refusals are costly, this ticket designs a guarded delivery in S: option (b) from #538's note, done properly. The adversarial review of (b) sets its requirements:

  1. A witness. If the person's window can't be identified (an AXFocusedWindow read fails), don't post. A guard without a witness reports repairs it never made (Activation.swift:176, :689–705, :954–969).
  2. A recheck at commit. Revalidate the front and intervention immediately before the events, after any blocking AX setup, and refuse on change. Otherwise the guard protects the app the person just left, or abandons the repair (:636–652, :677–686).
  3. A baseline. Read the initial order, and repair only a crossing the click caused (as PopUpPoint:659–670 does), never a legitimate pre-existing order such as a key panel already above.
  4. Scope. Shared pointer delivery only. Leave paste and dedicated mode alone: pasteOperation calls deliver() for the first ⌘V, and a lookup between the pasteboard write and ⌘V lets the person's copy reach the target.
  5. Qualify S independently. Use front and key readings plus the document window id, not a marker computed by the code under test, and drive the real carriers in tests.

Update: the hosted probe of S (accepted by design)

Run https://github.com/SSFSKIM/cua/actions/runs/45272638524, branch probe/538-s (e9e8da3). Findings are in ~/.local/share/538/probe-s/findings.md on the MacBook, and the scene is scripts/probe-538/ on that branch.

Activity

  1. added
    bug
    status:ready-for-architect
    priority:P2
    on Nov 23, 2026
  2. SSFSKIM commented on Nov 23, 2026

    @SSFSKIM
    OwnerAuthor

    Body updated with the probe of S (run 45272638524): the scene, the counts, and the note that in S main-window pointers come only from stale element tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2status:ready-for-architect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions