Skip to content

Shared-mode posted click still reorders the target window above the person's; #321's hold only hides it #324

Closed

Description

@SSFSKIM

Residue of #321: the reorder is hidden, not absent

#321's fix holds screen updates until the window order reads back, capped at 200 ms (design session ruling 90ec27dd). That makes the reorder invisible, but the reorder is still real:

  • A shared-mode posted click that uses the in-window activation-point click still makes the target window (Safari, an AppKit app) order itself above the frontmost app's window.
  • The engine's delivery guard repairs it. The repair is hidden only when it finishes inside the hold.

Measured on the hosted runner (probe/313-ab bd34950, run https://github.com/SSFSKIM/cua/actions/runs/42427423176):

  • with the hold, 2 of 240 Safari shared clicks still raised visibly;
  • both came on clicks whose guard ran past the cap.

Work

  1. Find a click sequence that delivers without the reorder. Two candidates were measured, and neither works:
    • (a) skipping the activation-point click: 0 of 220 delivered;
    • (b) an inert click just outside the frame: it still raised, 110 of 220.
  2. The guard outlier. One guard took 1,816 ms (the other cap hit, 241 ms). Its delivery record is in ~/.local/share/probe-321/run-42427423176/, in the hold-fallback job; candidates.txt and the per-cell results name the click. If the record shows a guard that can stall, that is a separate bug: register it.
  3. Dedicated mode has no hold. The target's window rises above the person's window and stays there, 60 of 60. State whether that is intended, or fix it.

Evidence

Activity

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

    @SSFSKIM
    OwnerAuthor

    The fix's hosted A/B on Safari (PR #325)

    Measured on PR #325's hosted A/B: https://github.com/SSFSKIM/cua/actions/runs/42433936787 and https://github.com/SSFSKIM/cua/actions/runs/42435717658. The evidence is in docs/evidence/2026-11-07-shared-raise/.

    • What is left visible: 3 of 220 Safari shared clicks. Every one came after a slow activation, 133–201 ms before the click's events.
      • The 200 ms cap counts from the activation's hold start, not from the click's events. Those clicks had 65 ms or less of hold after their events.
      • None of the 202 clicks with a gap of 100 ms or less raised visibly.
      • Likely fix: time the cap from the events. That raises the worst-case freeze, so it is the design session's call.
    • The hold is in practice a flat ~200 ms. The activation's ~60 ms plus the guard's 150 ms least wait already reach the cap, so the read-back release almost never shortens it.
    • The long-guard class recurs, on both heads, on the first click of a fresh Safari and engine. The fix: 456 ms and 253 ms. Main: 474, 404, 364 and 304 ms, and 1,173 ms in the confirmation run (raiseLeft true, repaired 1,127 ms after the release). The original 1,816 ms outlier was also a first click. The 456 ms record shows the guard running about 300 ms past the order reading back, with nothing left to repair. The records are in the evidence folder's ab-full.txt and ab-confirm.txt, under "guards above 250 ms".
  3. SSFSKIM commented on Nov 8, 2026

    @SSFSKIM
    OwnerAuthor

    A measured option: time the cap from the click's events (design session ruling 2eb4469a: not adopted for now)

    The cap stays counted from the hold's start until the owner answers on the freeze cost.

    The option: count the 200 ms from the click's events instead.

    • What it would hide: all 3 visible raises left in PR Engine: a shared-mode click whose activation clicked its in-window point holds the screen until the window order reads back, capped at 200 ms (#321) #325's A/B. Each came after an activation that ran 133–201 ms before the events, which left 65 ms or less of hold after them.
    • What it would cost: the freeze would become the activation's time plus 200 ms. The activation usually takes about 60 ms, so a typical freeze would be about 260 ms, against about 200 ms now. The slowest activation measured, 201 ms, would give a freeze of about 400 ms. In general the worst case is the activation's guard time plus 200 ms. I haven't checked what bounds that guard time.
    • A middle course, if wanted: count the cap from the events, but keep a total ceiling (for example 300 ms) measured from the hold's start.
  4. SSFSKIM commented on Nov 8, 2026

    @SSFSKIM
    OwnerAuthor

    Another raise the hold doesn't catch: set_value's posted fallback click on a background Firefox field (main fc3b080)

    #315's hosted A/B measured this. Run: https://github.com/SSFSKIM/cua/actions/runs/42457001051, with confirmations https://github.com/SSFSKIM/cua/actions/runs/42459610340 and https://github.com/SSFSKIM/cua/actions/runs/42460845888. The kit is probe/315-ab.

    • What it is: in shared mode on main, set_value on an unfocused Firefox page text field falls back to a posted focusing click. The click succeeds and the value is set.
    • The raise: Firefox's window rose above the frontmost TextEdit's 26–30 ms after the screen hold's release, in 4 of 5 tries.
    • Gecko is fixed in Gecko: shared-mode page clicks take #282's element route and #283's focus route, since Firefox refuses first mouse #315. That fallback now focuses through the field's own AXPress plus a focus read-back, and nothing is posted.
    • Why it belongs here: it is the same class as this ticket's residue. A posted click's reorder lands after the hold, so the hold doesn't hide it. Any other app whose set_value or select_text fallback posts a click can still show it.
  5. SSFSKIM commented on Nov 8, 2026

    @SSFSKIM
    OwnerAuthor

    Safari: set_value's posted fallback raises the window on main too (#315's controls)

    In #315's hosted controls, Safari's shared-mode set_value on an unfocused page field took the posted fallback click on both heads. It raised Safari above the frontmost TextEdit 14–33 ms after the hold: main fc3b080 6 of 8 tries, and #315's branch 5 of 8. The value was set 8 of 8. Run: https://github.com/SSFSKIM/cua/actions/runs/42465445014 (kit probe/315-ab).

    This is the same class as the Firefox case above: a posted fallback click whose reorder lands after the hold. #315 fixes it only for Gecko, by focusing through the field's press. On Safari the posted path is unchanged.

  6. added
    priority:P1
    status:in-progress
    and removed
    priority:P2
    status:ready-for-implementer
    on Nov 8, 2026
  7. SSFSKIM commented on Nov 8, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: measure-first spike (ruling a482186c)

  8. SSFSKIM commented on Nov 8, 2026

    @SSFSKIM
    OwnerAuthor

    Correction: the set_value raises in the two comments above were hidden, not visible

    The two comments above ("Another raise the hold doesn't catch" for Firefox, and "Safari: set_value's posted fallback raises the window") were wrong. Those raises came inside the screen hold, not after it.

    Runs:

    The kit is probe/324-measure (1b1b69a).

    The build proposal (a caret-first focus route on WebKit, keeping the fallback's delivery record, and the cap-start option) is with the design session.

  9. added
    priority:P2
    and removed
    priority:P1
    on Nov 8, 2026
  10. 9 remaining items

  11. added
    status:in-review
    on Nov 8, 2026
  12. SSFSKIM commented on Nov 8, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #329 open

  13. removed
    status:in-review
    on Nov 8, 2026
  14. SSFSKIM commented on Nov 8, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #329 (0.27.8)

  15. added a commit that references this issue on Nov 23, 2026
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:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions