Skip to content

macOS engine: when route 3's activation guard fails in shared mode (activationFailed), the target's window is left raised above the person's window #485

Open

Description

@SSFSKIM

Problem

In shared mode, route 3's activation guard sometimes fails on a click into Chrome while Chrome is behind the person's window. The action is refused, honestly, with activationFailed ("the app's window did not stay behind the frontmost window within 1 s"). But the target's window is left listed above the person's window. It stays there from about 1.03 s after the click to the end of a 3 s watch. Frontmost and key window don't change.

Ruling 1069 makes a background click that raises the target's window above the person's window a failure, even when focus doesn't move. Main has this on its own code path, so it's registered under 891 as a P2 (ruling 1069).

Evidence

Cell datalist/shared-behind/p-element: main's element click by ID on a Chrome datalist row (route 3), Chrome behind a TextEdit cover. 20 rows per head; kit probe/453-measure, README 0d52741, §"The shared-mode raise in datalist/shared-behind/p-element, pinned down".

Head activationFailed raised at end first raised
main 5580ac2, https://github.com/SSFSKIM/cua/actions/runs/45082409495 2/20 2/20 1038, 1022 ms
fix/453-axpress a8307c6, https://github.com/SSFSKIM/cua/actions/runs/45084310309 1/20 1/20 1054 ms

Where to look

native/engine/Sources/Engine/Activation.swift, the route-3 guard. A 10 ms poll for up to 1 s answers the target's window ordering above the user's focused window with AXRaise on the user's window. When the poll times out, the action is refused, but nothing restores the window order on that failure path.

Acceptance

  • Measure first: how often the guard fails on Chromium transient UI and on ordinary page clicks.
  • On guard failure, the person's window is back above the target's by the end of the action, or the failure is prevented.
  • datalist/shared-behind/p-element: raised at end 0/N on ≥40 rows. Main's other shared-mode route-3 cells: unchanged.

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