Skip to content

macOS engine: a pointer click joining another connection's hold or a recorded menu span is an ordering click the guard repairs #279

Open

Description

@SSFSKIM

Problem & intent

PR #261 (#187) consumes route 3's activation arm (set by subtype 1 in an app that doesn't believe it is active) by one of two kinds of holder:

  • A no-click holder (paste, ⌘ key equivalents, AXPress element actions, set_value, select_text, the secondary action, the menu record, a non-left click) posts an inert click right after subtype 1, so its keys meet a key window.
  • A pointer holder (a left coordinate click, a synthesized element click, a drag, focusField's fallback) posts no early click. Its own left mouse down consumes the arm on AppKit's branch 1, which makes the window key and main with no ordering. That keeps Own engine brings the driven app to the front in MAWS sessions (MacBook opt-in build) #200's raise away from the most common background action, a click into Chrome.

The two kinds share one activation per process (HeldActivations.acquire, MenuSpan.swift). #261 handles the sequence within one connection: a pointer holder that joins a shared activation whose arm is consumed, while every holder belongs to its own connection, ends that activation (subtype 2) and takes a fresh one (subtype 1), so its own mouse down consumes a new arm. That is the fix for ⌘L or AXPress into a background Chrome followed by a click (the spec's Decision Log, 2026-11-05).

Two cases keep the old join. In both, the pointer's mouse down meets a key window of an app that believes it is active, and that click is an ordering click (isOrderingMouseDown): the target's window rises above the person's, and the target's process may come forward.

  1. Another connection's holder. A holder from another connection may be mid-action, so ending its activation under it is not safe.
    • The interleave inside one activation: a no-click holder on another connection joins between the pointer holder's activation and its claim (FakeActivation.postAction), finds the arm set and unclaimed, and posts the inert click.
    • The lingering hold: another connection's ⌘ or element hold already consumed the arm.
    • It needs two connections driving one pid.
  2. A recorded menu span. The connection's menu record holds the activation, and the model is about to click into the menu it opened. Deactivating could close that menu and break a click that works today, so the join stays and the click may order the window.
  3. An in-frame activation point. On TextEdit, Finder and Electron the activation posts its click at the window's own inert activation point, inside the frame, for every holder (unchanged since before Engine: an activation never leaves an arm (inert click), the multi-line paste settles each Return, and item 187's re-slot kit (refs #187, refs #188) #261). A pointer action joining such a hold, or running its own activation, finds the arm already spent by that click, so its mouse down also meets a key window. A fresh activation would post the same click again, so Engine: an activation never leaves an arm (inert click), the multi-line paste settles each Return, and item 187's re-slot kit (refs #187, refs #188) #261 doesn't swap there. Whether that down orders the window is unmeasured.

What it costs today. The delivery guard (#200, FakeActivation.deliver) answers it:

  • In the hold: the person's window is raised back and their app made frontmost again, all inside the screen-update hold (SLSDisableUpdate, capped at 100 ms, activationHoldCapMs). The guard samples every 10 ms until deliveryGuardStableSamples (3) samples in a row find the order right. Within the cap, the raise doesn't show on screen.
  • Past the cap: the repair goes on inside the 1 s repair window as a visible flash (repairedAfterRelease). Past that it ends with the raise left as is (capped, raiseLeft).
  • Records: each repair is recorded on the connection (afterActionRepairs).
  • On the click and the target: the click still delivers, since the window is already key and there is no first-mouse swallow. The target app gets one more became-active/resigned-active pair when its process came forward and was sent back.
  • Cost: the action pays the guard's extra samples (on the order of tens of ms) and the display hold, and the target's window may visibly flash on a slow repair.

Intent: a pointer action into a background app is never an ordering click, however the activations before it were shared, or the cost is measured and accepted with numbers.

Constraints

Success criteria

  • Live, measure the cases with a raise watcher (the first two on Chrome for Testing behind TextEdit, the third on TextEdit behind another app: a ⌘ key equivalent, then a coordinate click), and report whether the click orders the window, the guard's repairs, its time, and whether anything showed on screen:
    • two connections: one connection's ⌘ key equivalent, then another's coordinate click into the same window;
    • a menu recorded open on Chrome, then a coordinate click into it.
  • A ruling from those numbers. Either:
    • accept the cost, with the numbers in the spec's Decision Log; or
    • change the join. Options: the registry learns which holders are mid-action (a per-action in-flight count on the activation), so an idle other-connection hold can be re-activated like a same-connection one; or the menu span's click goes through the menu's own route.
  • A test that fails today for each changed case.

Decision log

Sources

Activity

  1. added
    bug
    status:ready-for-architect
    priority:P3
    on Nov 5, 2026
  2. added 4 commits that reference this issue on Nov 5, 2026
  3. SSFSKIM commented on Nov 5, 2026

    @SSFSKIM
    OwnerAuthor

    Measured at the 2026-11-05 isolating slot (main 1c4b7e6's build 375d42a25333; records in docs/evidence/2026-10-30-macos-agent-cursor/item-187-isolate/, PR #281). 3 repetitions each, no verdict:

    • (b) The menu span. A menu was recorded on Chrome for Testing (the last menu-bar item, Help), then a coordinate click went into its page with no observation in between.
      • No menu read as open at the click.
      • The click's activationJoin was fresh in all 3, so the span had ended before the click, as menuSpanStep returns .endBefore for a coordinate click on one connection.
      • 0 raises, 0 delivery-guard restores, 0 after-action repairs, nothing out of place after the display hold. The time from post to hold release was 55–69 ms.
      • So on one connection, a pointer inside a recorded menu span doesn't arise. That case needs another connection (case 1, two connections), which this slot left out.
    • (c) In-frame. TextEdit was behind the run's Finder window. ⌘↑, then a coordinate click into the text.
      • The key's activation posted its click at the in-frame activation point (activationPoint early, join fresh), and the click joined shared in all 3.
      • 0 raises (the order watcher never saw TextEdit above Finder), 0 restores, 0 after-action repairs, nothing out of place after the hold. Post to release took 60–63 ms.
      • In 3 of 3, the pointer's down meeting a key window did not order TextEdit's window.
    • A related reading, from C3 (a Chrome popup with an in-frame activation point): ⌘A, then a click on its close button joined shared, and the click closed the popup in 3 of 3. That click reached the page.
    • Separately, the slot's C2 row and (b)'s clicks show the page receiving no mousedown when the pointer's own down consumes the activation arm (join rearmed or fresh). It is being investigated as its own engine bug, and will be filed and linked here.

    Sminos-Session: cursor235#b93055dd (cua on macbook)

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:P3status:ready-for-architect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions