Skip to content

macOS engine: a left click into a background Chrome page is swallowed as the window's activating click, and cua reports success #282

Closed

Description

@SSFSKIM

Problem & intent

A left coordinate click into a background Chrome page never reaches the page, and cua reports success. The same holds for a synthesized element click, focusField's fallback and a drag.

Live, 2026-11-05. The isolating slot ran on main 1c4b7e6's build 375d42a25333, with records in docs/evidence/2026-10-30-macos-agent-cursor/item-187-isolate/. Chrome for Testing was behind TextEdit, and the counters page logs document-level capture mousedown and click. It recorded mousedown 0, click 0 for 4 of 4 route 3 coordinate clicks posted at the textarea's centre:

  • C2 repetition 1 (item-187-iso-raise-0.jsonl): ⌘L, then the click, with activationJoin rearmed;
  • C4 (b), all 3 (item-187-iso-menu.jsonl): a menu record, then the click, with join fresh.

Each time the window became key (the page's window and textarea focus counts rose), and the result's delivery read clean with 0 restores.

The in-frame paths delivered: C3's popup close button (activationPoint early, join shared) closed its popup 3 of 3, and #188 cell 3 (ii) on Electron moved the caret.

The cause, confirmed statically:

  • Chrome's AXActivationPoint lies outside its frame, so route 3's activation posts no click at the point. For a left pointer holder (postsLeftMouseDown, defersArmClick) it also posts no early inert click (Activation.swift:575–600).
  • The pointer's own down is then the first mouse event after subtype 1 (postAction, Activation.swift:633–647, recorded activationClickKind {action, consumedByAction}).
  • AppKit's sendEvent: mouse-down path (25G83, ~/.local/share/187/appkit/d-md.txt) takes branch 1 under _mouseActivationInProgress. It makes the window key and main with no ordering (+2180 to +2196), then asks view:acceptsFirstMouseEvent:initialKeyWindow: (+2792). On NO it clears _lastLeftHit (+2960), and no view gets mouseDown: or the up.
  • Chromium's RenderWidgetHostViewCocoa acceptsFirstMouse: answers YES only for windows above normal level (content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm:922–938), so a page refuses first mouse.
    • Chromium 212c026a (2026-10-09) adds a YES for another process's clicks, but only when !NSApp.active. The pinned Chrome for Testing 155.0.8059.84 predates it.
    • Even with it, subtype 1 sets the app active, so route 3 would still be refused.
    • BridgedContentView acceptsFirstMouse: answers YES, so Chrome's own native controls do receive the click.

History.

The vendor. Its background click (route 2) posts the pair at AXActivationPoint wherever it lies (R/F-helper-logic.md:79–83, :416–424). On Chrome that is the sit2 sequence, which delivers at the cost of an ordering click (a raise). No recorded vendor row shows a page receiving a background coordinate click: the native matrix's vendor background-Chrome rows are all invalid (R/m2b/hold3/summary-as-recorded.md:210–221). sit2 measured cua's forced route 2 at 3 of 3 on Chrome. So against the vendor this is a regression in delivery, traded for #200's no-raise.

Affected. Any route 3 left pointer action whose down meets a set arm because the activation point wasn't clicked (outsideFrame, control, actionsUnknown, hitTestFailed, noPoint), into a view that refuses first mouse:

  • the coordinate click (Input.swift:389);
  • the synthesized element click (ElementInput.swift:227);
  • focusField's fallback (ElementInput.swift:240–249), which joins set_value's hold and so takes rearmed;
  • the drag (ScrollDrag.swift:160), which goes nowhere.

A double click loses its first press. Right and middle clicks are unaffected, since they post the early inert click.

The success report can't notice. deliver samples only the frontmost app and the window order.

Intent. A pointer action into a background app delivers its click, or the result says it didn't. The engine never answers success for a click the page didn't take.

Constraints

Success criteria

  • Live, on background Chrome for Testing with page counters (add pointerdown and mouseup), compare the shipping build against the fix:
    • a fresh coordinate click;
    • a forced route 3 element click on the checkbox;
    • ⌘L, then a click;
    • set_value's focus fallback;
    • a drag;
    • on the shipping build only, a click on Chrome's own toolbar (the control: it should receive the click).
  • The page receives each click exactly once, and the raise is repaired inside the hold or shown with numbers.
  • A unit test that fails today: a left pointer holder into a window whose activation point is outside its frame posts an arm-consuming click before its own down, or the result reports the click as unconfirmed.
  • An honest result where delivery can't be achieved: the route's consumedByAction signature (the down was the activating click) surfaces as an unconfirmed click, never as plain success.

Design (the design session's ruling, 1ea561bc 33e95829, 2026-11-05)

The rule it applies. The owner has already ruled this class: "On a shared desktop, cua refuses input an app ignores. A dedicated desktop may bring the window forward." That ruling is the Linux engine's device mode (docs/doperpowers/specs/2026-10-28-own-linux-engine-design.md, "Device mode and the foreground route"). Chrome's web content ignores a background first mouse, so the same split applies on macOS.

Which targets are affected. A left pointer action whose down would consume the activation arm: route 3, the activation point not clicked, and defersArmClick. Within that, the target counts as a Chromium web area when both of these hold:

  • the target process is Chromium-shaped (webShaped, Enablement.swift);
  • the AX hit element at the pointer's point is an AXWebArea, or lies inside one.

Chrome's own toolbar and other native views, whose BridgedContentView accepts first mouse, keep today's path.

Shared mode (the default):

  • A left click, double click or drag into a Chromium web area is never posted as a pointer.
  • If the hit element advertises an action (AXPress), the click goes by the element route: route 1, the accessibility action, no mouse event. Item 1 of Visible agent cursor on macOS (opt-in overlay in cua's own engine at the agent's target point) #235's sitting showed that route delivers on a background page.
  • Anything else is refused with a stated sentence naming the cause and the remedy, in the Linux engine's form: <App>'s web page does not accept a background click; bring <App> forward or use a dedicated desktop. That covers a click with no action, a double click, a drag, and focusField's fallback inside a web area.
  • Nothing is posted. That rules out double delivery, the reason detection with a retry was rejected on Linux.

Dedicated mode:

  • The early inert click is posted for left pointers too (no defersArmClick), so the down meets a key window and is delivered.
  • The window may come forward, and the delivery guard does not put the person's order back for that action, since nobody is at a dedicated desktop. This is the Linux foreground route's choice.

The mode:

  • It is resolved as on Linux: CUA_DESKTOP_MODE, else ~/.config/cua/engine.json's desktop, else shared. Today desktopModeFor in src/runtime/launch.mjs resolves it for Linux only. It extends to macOS sessions on cua's engine.
  • The macOS engine is one process shared by many connections, so the mode reaches it per connection: a field of the connection's handshake (the service passes it), never a global setting.
  • Doctor reports the mode for macOS too.

Everywhere, the honest result. Some actions still post a pointer whose own down consumes the arm (activationClickKind {action, consumedByAction}) into a target that is not known to accept first mouse. Today those are non-Chromium apps with an activation point that wasn't clicked (outsideFrame, control, actionsUnknown, hitTestFailed, noPoint). Such an action answers unconfirmed, with a sentence (clickUnconfirmed, like pasteUnconfirmed): the click was posted but may only have activated the window. It never answers plain success. Chromium's non-web views count as known to accept. This alone ends the silent loss.

rearmed stays only where it still pays: a shared-mode pointer into a view that accepts first mouse, such as Chrome's toolbar. Dedicated mode doesn't need it, and shared mode no longer posts pointers into web areas.

Rejected:

  • A as stated (always post the early inert click): on a shared desktop it brings back Own engine brings the driven app to the front in MAWS sessions (MacBook opt-in build) #200's raise for every background Chrome click, against the owner's ruling. It is kept only as dedicated mode.
  • B, post the down twice: double-delivers wherever a view accepts first mouse (a window above normal level, Chrome's toolbar), and leaves an extra press in an app's state.
  • C, plan by acceptsFirstMouse for every app: AX exposes no acceptsFirstMouse. The web-area test above is the one narrow, checkable case that the evidence and Chromium's source support, and the honest result covers the rest.
  • D, route 2′ on Chrome builds with 212c026a: sit2 measured 2′ failing on Chrome 155. AppKit's inactive-app path still orders the window (+2756) and changes the key window (+2768). And it depends on a Chrome version the harness doesn't pin. It may be revisited once Chrome for Testing carries the commit.

Acceptance

  • Engine unit tests that fail on main:
    • Shared mode with a Chromium web-area hit: no mouse event is posted. The click takes route 1 when the hit advertises AXPress, and otherwise is refused with the sentence. The same holds for the double click, the drag and focusField's fallback.
    • Dedicated mode: the early inert click is posted before the pointer's down.
    • Everywhere: consumedByAction into a target not known to accept first mouse answers clickUnconfirmed.
  • Hosted Chrome for Testing A/B (no owner): Chrome for Testing in the background on a page with pointerdown, mousedown, mouseup and click counters.
    • The control, main's build: the click is lost (0 events, success reported).
    • Shared mode: the click is refused, or element-routed and delivered (an AXPress checkbox toggles once). The page never receives a pointer event it didn't take.
    • Dedicated mode: delivered exactly once (1 pointerdown, 1 click).
    • Chrome's toolbar keeps delivering in shared mode.
  • Review: reviewer-high on the engine diff.
  • Docs: the spec's Decision Log entry, and the first-call document's sentence for the refusal.

Sources

Activity

  1. added
    bug
    status:ready-for-architect
    priority:P1
    status:in-design
    status:in-progress
    and removed
    status:ready-for-architect
    status:in-design
    on Nov 5, 2026
  2. SSFSKIM commented on Nov 5, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: Design ruled by the design session (1ea561bc 33e95829): shared mode element-routes or refuses Chromium web-area pointers, dedicated mode posts the early inert click, clickUnconfirmed everywhere; written into the body.

  3. 31 remaining items

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:P1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions