Skip to content

macOS engine: a person's key into a panel the activation itself focused goes unseen until the keys are posted #583

Backlog

Description

@SSFSKIM

Problem. The intervention detector records a person's events only for processes some connection already drives (InterventionLedger.record). Since #582, every key route drives the process its early read names (before the paste lock and the activation), and the process its final read names (after the activation, just before the first key). Only the final read's process receives the keys. Suppose the final process is one that nothing registered earlier. Then any key the person types into it between the early read and the final read is never recorded. That window covers the paste lock's wait and the activation. The action then posts its keys over the person's input instead of refusing with userChanged.

When it occurs. Only when the final owner differs from every process driven before it:

  • The activation moves focus. The activation (press_key's focus hold, a forced route 3, or the paste's route-3 activation) moves focus from the document into a remote-view panel (an Open or Save panel's service). The panel's service is then first driven at the final read. This is the main case.
  • The two reads disagree while focus stays put. Both reads walk the same chain, so they agree unless one of them is cut short and the other is not: the early walk stopped at its 250 ms budget or at the deadline, an _AXUIElementGetActualPid read failed once, or the service had not finished launching at the early read. This is a narrow race.

In the usual case the panel is already focused before the action. The early read then names the service, the service is driven from the start, and the person's key is seen.

Why not fixed now. The early read cannot know a panel the activation has not yet focused. Driving every prohibited-policy process the app might show would watch processes the action never touches. The window is short: one activation plus the lock's wait. And an activation that brings a panel into focus is not something any judged cell does today.

A possible fix. At the final read, when its owner was not driven before, check that owner's events since the action began. The tap could keep a short, bounded history for undriven processes, a few seconds per pid of the app's process tree. Another route: register the app's known remote-view services (those an observation has met; observationRead already drives the owners it meets) at the action's start. Either way, a key into the newly focused panel during the activation becomes visible to the final check.

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-implementer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions