Stage 0 review: correct what the log does not say, and edit the plan
The Stage 0 review (docs/reviews/2026-10-04-stage0-review.md, verdict
yes-with-fixes) found that the measurements were sound and the write-up
was not. All four of its high and medium defects, verified against the
committed transcript before fixing:
(1) 19e484b's README claimed a verbatim excerpt and printed serial=336
while the run's (a2) enter was serial 371. It also claimed six
reproductions with one transcript, and cited a `keys=[42, 0, 0, 0]`
enter from a run whose log was never kept -- every enter in the
committed file is `keys=[]`. The excerpt is now copied from the log
with line numbers to check it against, the reproduction claim is
gone, and the Shift observation is named as not-in-this-log.
(2) THE (a) CONCLUSION WAS WRONG, and it is the one that matters. The
first idle warp onto the unfocused window gave wl_pointer.enter and
NO keyboard enter; the leave/enter arrived on the LATER motion. So
it is not "enter, one warp late" -- the first warp's delta is set to
0, the threshold is 0.0, and the second motion's own non-zero delta
is what focused. Two corollaries the old text got backwards: a
second warp to the SAME point returns before mouseMoveUnified
touches the delta and proves nothing, and waiting longer does not
help. The probe now prints both targets and the measured gap
(0.401s) instead of hardcoding the word "immediately", and its
ANSWER string says the mechanism.
Consequence, now stated everywhere it belongs: `pointer acquire` is
one warp, so the first key of a lease can land on whatever was
already focused. Stage 3's enter subtest must not be designed from
acquire's single warp, and must not be made to pass by warping twice
to the same bookmark.
(3) d07a1fd did not edit the plan -- `git diff 14b3f69 HEAD --
docs/plans/2026-10-03-keyboard-input.md` was empty, so anyone told
to follow the plan still had the contradicted text. All eight
pre-code changes are now folded into that file, each marked
[SUPERSEDED], plus a banner at the top. Changes 5 and 7 were the
ones that had survived intact in four places: the [keyboard] TOML
table (dropped -- the broker reads that file and the driver is a
different unit, so it would have been a setting with no effect) and
"if it repeats, the help text says so" (now unconditional). The four
closed open questions and the stage table are updated with what
Stage 0 measured, including that Stage 4 is no longer contingent.
(4) mask_cleared=no was reported as a held mask surviving destroy. The
held key was a letter, so the mask was 0 throughout; the README now
says destroy emitted no key-up and no modifiers event, and that the
reason release_all still sends modifiers(0,0,0,0) is
VirtualKeyboard.cpp's releasePressed, not this line. The real
poison evidence is promoted: onKeyboardKey drops a release whose
code is not in m_pressed, so the cleanup's `key code=30 state=0`
arriving from a brand-new keyboard proves 30 was still in that set.
The transcript is a fresh run of the corrected probe, so the file and
the claims about it agree line for line.
19e484b's message carries defect (2)'s wrong causality. It is corrected
here rather than by rewriting that commit, so the hashes the reviewer
cites keep resolving.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GhNPM6rGcuzxocM1nATnuM
This commit is contained in:
1 parent
f931858f30
commit
b1f2744cf0
5 files changed
+439
-106
No files matched your search
+126
-52
@@ -49,6 +49,18 @@ protocol rather than growing a second copy.
|
||||
Flags: `--runtime-dir` (default `/run/hypr-stream`), `--xml`, `--output` (only
|
||||
needed if the compositor has more than one), `--xkb-layout`, `--xkb-model`.
|
||||
|
||||
### Where it deviates from the review's §B1 sequence
|
||||
|
||||
All three are visible in the transcript and none of them changes an answer:
|
||||
|
||||
- the keymap is uploaded **before** the windows are opened, not after. It has
|
||||
to be: the seat has no libinput keyboard, so `wl_seat.capabilities` does not
|
||||
include `keyboard` until a virtual one exists (the setup block goes `1` then
|
||||
`3`), and a listener bound any later would have seen nothing at all;
|
||||
- the idle wait before (a1) is 0.8 s rather than 0.6 s;
|
||||
- (a2) follows (a1) after the settle window and a print — measured at 0.401 s
|
||||
rather than being "immediate", and still inside the 0.5 s that matters.
|
||||
|
||||
Exit codes: **2** if `zwp_virtual_keyboard_manager_v1` is missing or is not
|
||||
version 1 — the gate the plan says stops the project — and 0 otherwise. The
|
||||
answers are in the output, not in the exit status: a measurement that came back
|
||||
@@ -85,10 +97,14 @@ path.
|
||||
|
||||
## What it answered
|
||||
|
||||
Run 2026-10-04 against the live `/run/hypr-stream`: Hyprland 0.56.2, one output
|
||||
`Virtual-1` at 1280x720, two Chromium windows already on screen. Reproduced
|
||||
across six runs. Full transcript, verbatim:
|
||||
[`keyboard-probe-2026-10-04.txt`](keyboard-probe-2026-10-04.txt).
|
||||
One run, 2026-10-04, against the live `/run/hypr-stream`: Hyprland 0.56.2, one
|
||||
output `Virtual-1` at 1280x720, two Chromium windows already on screen. The
|
||||
committed transcript is that run and nothing else —
|
||||
[`keyboard-probe-2026-10-04.txt`](keyboard-probe-2026-10-04.txt) — and every
|
||||
excerpt below is copied from it, with the line numbers to check it against. An
|
||||
earlier draft of this file claimed several reproductions and quoted a serial
|
||||
from a run it had not kept. If a claim here is not in that file, it is not
|
||||
evidence.
|
||||
|
||||
The configuration the answers depend on, as the compositor reports it:
|
||||
|
||||
@@ -103,68 +119,121 @@ input:kb_layout = us (default)
|
||||
|
||||
### 1. The global — the gate the whole project hangs on
|
||||
|
||||
**`zwp_virtual_keyboard_manager_v1` is present at version 1.** §6.7's `[RAN]`
|
||||
claim holds against the running binary. `wp_virtual_keyboard_v1` is not
|
||||
**`zwp_virtual_keyboard_manager_v1` is present at version 1** (transcript
|
||||
line 71, answered on line 76). §6.7's `[RAN]` claim holds against the running
|
||||
binary. `wp_virtual_keyboard_v1` is not
|
||||
advertised, as both plans predicted. `zwlr_virtual_pointer_manager_v1` is at
|
||||
v2, so the driver's existing version-2 requirement is still met. The project
|
||||
continues.
|
||||
|
||||
### (a) Does a virtual-pointer warp move `wl_keyboard` focus?
|
||||
|
||||
**One idle warp: NO. A second warp immediately after: YES.** Exactly what the
|
||||
review's read of `InputManager::onMouseWarp` predicted, and the reason it
|
||||
insisted (a1) and (a2) be measured separately.
|
||||
**One idle warp onto an unfocused window: NO.** It moved the cursor and
|
||||
nothing else. The keyboard focus change arrived only after a *later*
|
||||
`motion_absolute`, and it belongs to that motion rather than to the first.
|
||||
|
||||
Transcript, lines 104–120, unedited:
|
||||
|
||||
```
|
||||
box kb-probe-a at 0,0 size 1280x720 <- fullscreen, unfocused
|
||||
box kb-probe-b at 120,80 size 1040x560 <- focused: it mapped last
|
||||
chosen warp target 0.0100,0.0100 (inside kb-probe-a only)
|
||||
|
||||
(a1) one warp after 0.8s of stillness
|
||||
(a1) -> wl_pointer.enter surface=kb-probe-a at 13,7 <- cursor arrived
|
||||
<- and nothing else
|
||||
|
||||
(a2) a second warp, immediately, still inside the same window
|
||||
(a2) -> leave surface=kb-probe-b
|
||||
(a2) -> enter surface=kb-probe-a serial=336 keys=[] <- focus, one warp late
|
||||
|
||||
a1_enter=no a2_enter=yes pointer_reached_kb-probe-a=yes
|
||||
box kb-probe-a at 0,0 size 1280x720
|
||||
box kb-probe-b at 120,80 size 1040x560
|
||||
focus at map time: kb-probe-b (expected kb-probe-b: it mapped last)
|
||||
(a1) target 0.0100,0.0100 (inside kb-probe-a only)
|
||||
(a2) target 0.0100,0.0140 — about 3px lower, so the FLOORED pixel changes. A second warp to the same point would return before mouseMoveUnified touched the delta, and would prove nothing.
|
||||
(a1) one warp after 0.8s of stillness
|
||||
(a1) -> wl_pointer.enter surface=kb-probe-a at 13,7
|
||||
(a2) a second warp, to the (a2) target above
|
||||
(a2) -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
(a2) -> leave surface=kb-probe-b
|
||||
(a2) -> enter surface=kb-probe-a serial=406 keys=[]
|
||||
(a2) -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
(a2) -> configured surface=kb-probe-b 1040x560
|
||||
(a2) -> configured surface=kb-probe-a 1280x720
|
||||
gap between the two motion_absolute calls: 0.401s (under Hyprland's 0.5s delta window)
|
||||
a1_enter=no a2_enter=yes pointer_reached_kb-probe-a=yes
|
||||
```
|
||||
|
||||
The consequence is the headline risk of this whole feature: **`pointer
|
||||
acquire` is one warp**, so the first key of a lease can be delivered to
|
||||
whatever was focused before. Neither plan permits building the fallback in
|
||||
Stages 1–2 (`docs/plans/2026-10-03-keyboard-input.md` §6 risk 1; the review's
|
||||
"Do not build it in Stage 1"), so Stages 1–2 do not, and the final report
|
||||
carries the objection. Stage 3's enter assertion must not be written against a
|
||||
single warp.
|
||||
The sentence this supports, and no stronger one: **an idle `motion_absolute`
|
||||
onto unfocused `kb-probe-a` delivered `wl_pointer.enter` and no
|
||||
`wl_keyboard.enter`; `kb-probe-b`'s `leave` and `kb-probe-a`'s `enter` were
|
||||
observed only in the settle window after a later `motion_absolute` that stayed
|
||||
inside `kb-probe-a`.** Map-time focus was `kb-probe-b`, and the two boxes
|
||||
genuinely differ (`0,0 1280x720` against `120,80 1040x560`), so this is not the
|
||||
one-window false pass.
|
||||
|
||||
Worth recording about this probe, because it is the review's own category of
|
||||
false pass and it happened here: an earlier version matched the keyboard
|
||||
`enter` line with `"enter surface=kb-probe-a" in line`, which also matches
|
||||
`wl_pointer.enter surface=kb-probe-a`, and reported `a1_enter=yes`. The match
|
||||
is `startswith` now.
|
||||
It is **not** "the enter was one warp late", which is what an earlier draft of
|
||||
this file said. The mechanism is in `InputManager.cpp` at v0.56.2:
|
||||
`mouseMoveUnified` returns before it touches `m_mousePosDelta` when the floored
|
||||
pixel did not change; the delta is *set to* 0 when the previous movement was
|
||||
more than 0.5 s ago; and keyboard focus compares that delta against
|
||||
`input:follow_mouse_threshold`, which the options block above shows is `0.0`
|
||||
and unset. So the first warp contributed nothing to the delta, and the second
|
||||
warp's own non-zero delta is what focused. Two consequences the draft got
|
||||
wrong:
|
||||
|
||||
- **A second warp to the same point is not the fix.** It returns early. (a2)
|
||||
moves about 3 px, deliberately, and the report prints both targets so a
|
||||
reader can see that it moved.
|
||||
- **"Immediately" was never measured.** The gap is 0.401 s, now printed, and it
|
||||
matters only because it is under the 0.5 s window.
|
||||
|
||||
**`pointer acquire` is one warp** (`src/hhstreamd/manager.py`, the `_warp` in
|
||||
`pointer_acquire`), so the first key of a lease can be delivered to whatever
|
||||
was already focused. Neither plan permits building the fallback in Stages 1–2
|
||||
(`docs/plans/2026-10-03-keyboard-input.md` §6 risk 1; the review's "Do not
|
||||
build it in Stage 1"), so Stages 1–2 do not, and the final report carries the
|
||||
objection. **Stage 3's enter subtest must not be written against acquire's
|
||||
single warp**, and it must not be made to pass by warping twice to the same
|
||||
bookmark.
|
||||
|
||||
Two false passes this probe itself walked into, both worth carrying into the VM
|
||||
check:
|
||||
|
||||
- `"enter surface=kb-probe-a" in line` also matches
|
||||
`wl_pointer.enter surface=kb-probe-a`, and an earlier version reported
|
||||
`a1_enter=yes` off a *pointer* event. The match is `startswith` now.
|
||||
- An earlier version used one window. A single mapped window is focused at map
|
||||
time, so it prints `enter` whatever the warp does.
|
||||
|
||||
### (b) Does destroying the virtual keyboard release a held key?
|
||||
|
||||
**NO — `release_on_destroy=no`, `mask_cleared=no`**, measured with a second
|
||||
virtual keyboard keeping the seat's keyboard capability up, so that a release
|
||||
had somewhere to be delivered. `input:virtualkeyboard:release_pressed_on_close`
|
||||
is `0` and unset, which is the default the review read out of
|
||||
`ConfigValues.cpp`.
|
||||
**No release: `release_on_destroy=no`** (transcript line 131), measured with a
|
||||
second virtual keyboard keeping the seat's keyboard capability up so a release
|
||||
had somewhere to be delivered, and with nothing of ours having sent a key-up
|
||||
before `destroy`. `input:virtualkeyboard:release_pressed_on_close` is `0` and
|
||||
unset, which is the default the review read out of `ConfigValues.cpp`.
|
||||
|
||||
Corroborated by accident on an earlier run, which is the strongest form the
|
||||
evidence takes: a run that exited with `Shift_L` down and no spare device left
|
||||
the key down, and the *next* run's very first `wl_keyboard.enter` carried
|
||||
`keys=[42, 0, 0, 0]` — evdev 42 is `KEY_LEFTSHIFT`. The key outlived the
|
||||
process that pressed it. Sending the release from a different virtual keyboard
|
||||
cleared it, which is why the probe now ends with a fresh keyboard, a key-up and
|
||||
a zeroed mask (the review's step 7).
|
||||
**Read `mask_cleared=no` narrowly.** It says only that the post-destroy window
|
||||
contained no `modifiers` event. The held key was `KEY_A`, a letter, so the
|
||||
depressed mask was 0 for the whole run — **this is not a measurement of a
|
||||
non-zero mask surviving `destroy`**, and an earlier draft of this file claimed
|
||||
it was. `releasePressed` in `VirtualKeyboard.cpp` emits key-ups only and never
|
||||
a `modifiers`, so the source still says a mask would survive; it is simply not
|
||||
what this transcript shows. `release_all` sends `modifiers(0, 0, 0, 0)` for
|
||||
that reason, not because of this line.
|
||||
|
||||
This is worse than "a key stays down": `InputManager::onKeyboardKey` drops a
|
||||
press whose code is already in the seat's `m_pressed`, so after a `kill -9` the
|
||||
next driver's `key down` for that code is ignored and the key is dead until
|
||||
something sends a matching up. Handled in Stage 2 by
|
||||
The confirming evidence is the *cleanup*, transcript lines 136–138:
|
||||
|
||||
```
|
||||
cleanup -> uploaded keymap format=1 size=35572
|
||||
cleanup -> key code=30 state=0 sym=a
|
||||
cleanup -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
```
|
||||
|
||||
`InputManager::onKeyboardKey` **drops** a release whose code is not in the
|
||||
seat's `m_pressed`. A `state=0` for code 30 that the client actually received,
|
||||
sent from a *brand new* virtual keyboard, therefore means 30 was still in that
|
||||
set after `destroy`. Had destroy released it, that cleanup key-up would have
|
||||
been dropped and nothing would have reached the client.
|
||||
|
||||
One thing the transcript does **not** contain, and which this file used to cite:
|
||||
an earlier, unkept run whose first `wl_keyboard.enter` carried
|
||||
`keys=[42, 0, 0, 0]`. Every `enter` in the committed log is `keys=[]`.
|
||||
|
||||
So this is worse than "a key stays down": the code stays in `m_pressed`, and
|
||||
`onKeyboardKey` also drops a *press* whose code is already there — the next
|
||||
driver's `key down` for it is ignored, and the key is dead until something
|
||||
sends a matching up. Handled in Stage 2 by
|
||||
`input:virtualkeyboard:release_pressed_on_close = true` in
|
||||
`nix/hyprland-conf.nix` (the review's change 4), with the explicit note that
|
||||
the setting releases keys and still does not clear the modifier mask — which is
|
||||
@@ -173,8 +242,13 @@ regardless.
|
||||
|
||||
### (c) Does Hyprland auto-repeat a held virtual key?
|
||||
|
||||
**`press_count=1`, `repeat_info rate=25 delay=600`.** A key left down for 1.5 s
|
||||
— longer than the 600 ms delay — produced exactly one `wl_keyboard.key … state=1`.
|
||||
**`press_count=1`, `repeat_info rate=25 delay=600`** (transcript lines
|
||||
124–125). A key left down for `REPEAT_HOLD_S = 1.5` s — longer than the 600 ms
|
||||
delay, not shorter — produced exactly one `key code=30 state=1` and no
|
||||
`state=2`. A compositor repeating at 25 Hz after 600 ms would have added about
|
||||
twenty more lines in the remaining 0.9 s; it added none. `repeat_info` arrives
|
||||
at bind time, before the hold, and is printed next to the count because the
|
||||
review asked for both — not because the compositor repeated.
|
||||
|
||||
This is **not** "`keyboard down` will not flood a text field", and reading it
|
||||
that way is the review's named false pass. The compositor does not repeat on
|
||||
|
||||
@@ -81,13 +81,13 @@ ANSWER 1: zwp_virtual_keyboard_manager_v1 is present at version 1.
|
||||
setup -> wl_keyboard.keymap format=1 bytes=35572 symbols=xkb_symbols "pc_us_inet(evdev)" {
|
||||
setup -> repeat_info rate=25 delay=600
|
||||
setup -> configured surface=kb-probe-a 640x360
|
||||
setup -> enter surface=kb-probe-a serial=357 keys=[]
|
||||
setup -> enter surface=kb-probe-a serial=392 keys=[]
|
||||
setup -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
setup -> configured surface=kb-probe-a 1280x720
|
||||
setup -> configured surface=kb-probe-b 640x360
|
||||
setup -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
setup -> leave surface=kb-probe-a
|
||||
setup -> enter surface=kb-probe-b serial=365 keys=[]
|
||||
setup -> enter surface=kb-probe-b serial=400 keys=[]
|
||||
setup -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
setup -> configured surface=kb-probe-b 1040x560
|
||||
setup -> configured surface=kb-probe-a 1280x720
|
||||
@@ -104,18 +104,21 @@ ANSWER 1: zwp_virtual_keyboard_manager_v1 is present at version 1.
|
||||
box kb-probe-a at 0,0 size 1280x720
|
||||
box kb-probe-b at 120,80 size 1040x560
|
||||
focus at map time: kb-probe-b (expected kb-probe-b: it mapped last)
|
||||
chosen warp target 0.0100,0.0100 (inside kb-probe-a only)
|
||||
(a1) target 0.0100,0.0100 (inside kb-probe-a only)
|
||||
(a2) target 0.0100,0.0140 — about 3px lower, so the FLOORED pixel changes. A second warp to the same point would return before mouseMoveUnified touched the delta, and would prove nothing.
|
||||
(a1) one warp after 0.8s of stillness
|
||||
(a1) -> wl_pointer.enter surface=kb-probe-a at 13,7
|
||||
(a2) a second warp, immediately, still inside the same window
|
||||
(a2) a second warp, to the (a2) target above
|
||||
(a2) -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
(a2) -> leave surface=kb-probe-b
|
||||
(a2) -> enter surface=kb-probe-a serial=371 keys=[]
|
||||
(a2) -> enter surface=kb-probe-a serial=406 keys=[]
|
||||
(a2) -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
(a2) -> configured surface=kb-probe-b 1040x560
|
||||
(a2) -> configured surface=kb-probe-a 1280x720
|
||||
gap between the two motion_absolute calls: 0.401s (under Hyprland's 0.5s delta window)
|
||||
a1_enter=no a2_enter=yes pointer_reached_kb-probe-a=yes
|
||||
ANSWER (a): one idle warp did NOT deliver enter; the SECOND warp did. Exactly what the review predicted. A lease's `acquire` is one warp, so the first key of a lease can land in the previously focused window: Stage 4 (or a second warp) is needed, and Stage 3's enter assertion must not be written against a single warp.
|
||||
ANSWER (a): the idle warp onto unfocused kb-probe-a delivered wl_pointer.enter and NO wl_keyboard.enter. kb-probe-b's leave and kb-probe-a's enter arrived only after the LATER motion_absolute, the one that changed the floored pixel -- so the enter belongs to that motion's non-zero m_mousePosDelta and is NOT a delayed effect of the first warp.
|
||||
Consequence: `pointer acquire` is one warp, so the first key of a lease can land in whatever was already focused. Stage 3's enter subtest must not be written against acquire's single warp, and warping twice to the same bookmark is not the fix -- the same floored pixel returns early.
|
||||
|
||||
=== (c) is one held virtual key one wl_keyboard.key? ===
|
||||
key code=30 state=1 sym=a
|
||||
@@ -127,7 +130,9 @@ ANSWER (c): press_count=1 — the compositor does not repeat on the wire; it pub
|
||||
spare -> uploaded keymap format=1 size=35572
|
||||
release_on_destroy=no mask_cleared=no
|
||||
(compare with input:virtualkeyboard:release_pressed_on_close, printed above)
|
||||
ANSWER (b): NO — destroy delivered no release, with another keyboard keeping the seat's capability up. So a driver killed with -9 leaves evdev 30 in the seat's m_pressed, and InputManager::onKeyboardKey then DROPS the next press of that code: the key is dead until something sends a matching up. _lift_everything is the only guard on the clean path, and SIGKILL skips it.
|
||||
ANSWER (b): NO RELEASE — destroy delivered no key-up, with a second keyboard keeping the seat's capability up and with nothing of ours having sent an up beforehand.
|
||||
Read `mask_cleared` narrowly: it says only that destroy emitted no `modifiers` event. The held key is a letter, so the depressed mask was 0 throughout -- this is NOT a measurement of a non-zero mask surviving destroy. releasePressed emits key-ups only (VirtualKeyboard.cpp), which is why release_all sends modifiers(0,0,0,0) regardless.
|
||||
The confirming evidence is the cleanup below: onKeyboardKey DROPS a release whose code is not in the seat's m_pressed, so a `key code=30 state=0` arriving from a BRAND NEW keyboard means the code was still in that set after destroy. A driver killed with -9 leaves it there and the next driver's press of it is dropped: dead, not merely stuck. _lift_everything is the only guard on the clean path and SIGKILL skips it.
|
||||
cleanup -> uploaded keymap format=1 size=35572
|
||||
cleanup -> key code=30 state=0 sym=a
|
||||
cleanup -> modifiers depressed=0 latched=0 locked=0 group=0
|
||||
|
||||
+89
-30
@@ -15,13 +15,27 @@ that script. It prints what it saw, not what it hoped for.
|
||||
mask cleared?
|
||||
(c) Is one held key one `wl_keyboard.key`, with `repeat_info` still sent?
|
||||
|
||||
(a1) and (a2) are separate questions on purpose. `InputManager::onMouseWarp`
|
||||
calls `mouseMoveUnified(refocus=false)`, and with `follow_mouse = 1` keyboard
|
||||
focus needs `m_mousePosDelta > follow_mouse_threshold` (default 0) — and the
|
||||
delta is reset to 0 when the previous cursor movement was more than 0.5 s ago.
|
||||
So one idle warp is expected *not* to move keyboard focus and a second one is.
|
||||
A probe that reported a single yes/no would hide exactly the thing the lease's
|
||||
`acquire` does: one warp, then immediately a key.
|
||||
(a1) and (a2) are separate questions on purpose, and (a2) is not a repeat of
|
||||
(a1). `InputManager::onMouseWarp` calls `mouseMoveUnified(refocus=false)`;
|
||||
with `follow_mouse = 1`, keyboard focus needs
|
||||
`m_mousePosDelta > follow_mouse_threshold`, that threshold is 0 by default, and
|
||||
the delta is *set to* 0 when the previous cursor movement was more than 0.5 s
|
||||
ago. So an idle warp is expected to move the cursor and not keyboard focus,
|
||||
and a following motion that changes the floored pixel inside 0.5 s is expected
|
||||
to focus.
|
||||
|
||||
Two things follow, and both are printed rather than assumed:
|
||||
|
||||
* **(a2) must land on a different pixel.** `mouseMoveUnified` returns before
|
||||
it touches the delta when the floored position did not change, so a second
|
||||
`motion_absolute` to the *same* point proves nothing. (a2) offsets by about
|
||||
3 px and the report prints both normalised points.
|
||||
* **The gap between them is a measurement, not the word "immediately".** It
|
||||
has to stay under 0.5 s for (a2) to be the in-window case, so the report
|
||||
prints the monotonic gap it achieved.
|
||||
|
||||
A probe that collapsed the two into one yes/no would hide exactly what the
|
||||
lease's `acquire` does: *one* warp, and then a key.
|
||||
|
||||
It talks to the compositor and to nothing else: **no broker, no lease, no
|
||||
`hhstreamd` socket, no `hhstream` CLI**. Read-only `hyprctl` is used to learn
|
||||
@@ -123,6 +137,12 @@ REPEAT_HOLD_S = 1.5
|
||||
#: would be read as a NO.
|
||||
SETTLE_S = 0.4
|
||||
|
||||
#: How far (a2) moves, as a fraction of the output's height. About 3 px on a
|
||||
#: 720-line output, which is what makes the floored pixel change —
|
||||
#: `mouseMoveUnified` returns early otherwise and never touches the delta
|
||||
#: keyboard focus is compared against.
|
||||
A2_OFFSET = 0.004
|
||||
|
||||
APP_A, APP_B = "kb-probe-a", "kb-probe-b"
|
||||
|
||||
#: Hyprland options the answers depend on, printed so a reader never has to
|
||||
@@ -800,7 +820,14 @@ def question_focus(probe: Probe, output_name: str, mode: tuple[int, int]) -> Non
|
||||
"Measure it in vm-keyboard, where two sessions have two outputs."
|
||||
)
|
||||
return
|
||||
say(f" chosen warp target {target[0]:.4f},{target[1]:.4f} (inside {APP_A} only)")
|
||||
second = (target[0], min(1.0, target[1] + A2_OFFSET))
|
||||
say(f" (a1) target {target[0]:.4f},{target[1]:.4f} (inside {APP_A} only)")
|
||||
say(
|
||||
f" (a2) target {second[0]:.4f},{second[1]:.4f} — about "
|
||||
f"{round(A2_OFFSET * mode[1])}px lower, so the FLOORED pixel changes. A "
|
||||
"second warp to the same point would return before mouseMoveUnified "
|
||||
"touched the delta, and would prove nothing."
|
||||
)
|
||||
|
||||
# The whole point of (a1): the cursor must have been still for longer than
|
||||
# Hyprland's 0.5 s window, or the delta from an earlier move carries it.
|
||||
@@ -808,23 +835,33 @@ def question_focus(probe: Probe, output_name: str, mode: tuple[int, int]) -> Non
|
||||
probe.report("idle -> ")
|
||||
|
||||
say(f" (a1) one warp after {IDLE_S}s of stillness")
|
||||
first_sent = time.monotonic()
|
||||
probe.warp(*target)
|
||||
probe.pump(SETTLE_S)
|
||||
first = probe.report("(a1) -> ")
|
||||
first_bucket = probe.report("(a1) -> ")
|
||||
|
||||
say(" (a2) a second warp, immediately, still inside the same window")
|
||||
probe.warp(target[0], min(1.0, target[1] + 0.004))
|
||||
say(" (a2) a second warp, to the (a2) target above")
|
||||
gap = time.monotonic() - first_sent
|
||||
probe.warp(*second)
|
||||
probe.pump(SETTLE_S)
|
||||
second = probe.report("(a2) -> ")
|
||||
second_bucket = probe.report("(a2) -> ")
|
||||
# Timed rather than asserted in prose: (a2) is the in-window case only
|
||||
# while this stays under 0.5 s, and an earlier version of this script
|
||||
# printed the word "immediately" about a gap it never measured.
|
||||
say(
|
||||
f" gap between the two motion_absolute calls: {gap:.3f}s "
|
||||
f"({'under' if gap < 0.5 else 'OVER'} Hyprland's 0.5s delta window)"
|
||||
)
|
||||
|
||||
# `startswith`, not `in`: `wl_pointer.enter surface=kb-probe-a` contains
|
||||
# the substring `enter surface=kb-probe-a`, and an `in` test here reported
|
||||
# a1_enter=yes off a pointer event. That is the review's own category of
|
||||
# false pass, found in this probe.
|
||||
entered_a1 = any(line.startswith(f"enter surface={APP_A}") for line in first)
|
||||
entered_a2 = any(line.startswith(f"enter surface={APP_A}") for line in second)
|
||||
entered_a1 = any(line.startswith(f"enter surface={APP_A}") for line in first_bucket)
|
||||
entered_a2 = any(line.startswith(f"enter surface={APP_A}") for line in second_bucket)
|
||||
pointer_moved = any(
|
||||
line.startswith(f"wl_pointer.enter surface={APP_A}") for line in first + second
|
||||
line.startswith(f"wl_pointer.enter surface={APP_A}")
|
||||
for line in first_bucket + second_bucket
|
||||
)
|
||||
say(
|
||||
f" a1_enter={'yes' if entered_a1 else 'no'} "
|
||||
@@ -833,18 +870,26 @@ def question_focus(probe: Probe, output_name: str, mode: tuple[int, int]) -> Non
|
||||
)
|
||||
if entered_a1:
|
||||
say(
|
||||
f"ANSWER (a): one idle warp DID deliver enter to {APP_A}. That is not "
|
||||
"what v0.56.2's threshold logic predicts, so this binary does not "
|
||||
"match the read of InputManager::onMouseWarp. Stage 3 must still "
|
||||
"assert it rather than assume it."
|
||||
f"ANSWER (a): the idle warp DID deliver wl_keyboard.enter to {APP_A}. "
|
||||
"That is not what v0.56.2's threshold logic predicts, so this binary "
|
||||
"does not match the read of InputManager::onMouseWarp. Stage 3 must "
|
||||
"still assert it rather than assume it."
|
||||
)
|
||||
elif entered_a2:
|
||||
say(
|
||||
f"ANSWER (a): one idle warp did NOT deliver enter; the SECOND warp "
|
||||
f"did. Exactly what the review predicted. A lease's `acquire` is one "
|
||||
"warp, so the first key of a lease can land in the previously "
|
||||
"focused window: Stage 4 (or a second warp) is needed, and Stage 3's "
|
||||
"enter assertion must not be written against a single warp."
|
||||
f"ANSWER (a): the idle warp onto unfocused {APP_A} delivered "
|
||||
f"wl_pointer.enter and NO wl_keyboard.enter. {APP_B}'s leave and "
|
||||
f"{APP_A}'s enter arrived only after the LATER motion_absolute, the "
|
||||
"one that changed the floored pixel -- so the enter belongs to that "
|
||||
"motion's non-zero m_mousePosDelta and is NOT a delayed effect of "
|
||||
"the first warp."
|
||||
)
|
||||
say(
|
||||
" Consequence: `pointer acquire` is one warp, so the first "
|
||||
"key of a lease can land in whatever was already focused. Stage 3's "
|
||||
"enter subtest must not be written against acquire's single warp, "
|
||||
"and warping twice to the same bookmark is not the fix -- the same "
|
||||
"floored pixel returns early."
|
||||
)
|
||||
elif pointer_moved:
|
||||
say(
|
||||
@@ -926,12 +971,26 @@ def question_destroy(probe: Probe) -> None:
|
||||
say("ANSWER (b): YES — destroy released the held key.")
|
||||
else:
|
||||
say(
|
||||
"ANSWER (b): NO — destroy delivered no release, with another keyboard "
|
||||
"keeping the seat's capability up. So a driver killed with -9 leaves "
|
||||
f"evdev {KEY_A} in the seat's m_pressed, and InputManager::"
|
||||
"onKeyboardKey then DROPS the next press of that code: the key is "
|
||||
"dead until something sends a matching up. _lift_everything is the "
|
||||
"only guard on the clean path, and SIGKILL skips it."
|
||||
"ANSWER (b): NO RELEASE — destroy delivered no key-up, with a second "
|
||||
"keyboard keeping the seat's capability up and with nothing of ours "
|
||||
"having sent an up beforehand."
|
||||
)
|
||||
say(
|
||||
" Read `mask_cleared` narrowly: it says only that destroy "
|
||||
"emitted no `modifiers` event. The held key is a letter, so the "
|
||||
"depressed mask was 0 throughout -- this is NOT a measurement of a "
|
||||
"non-zero mask surviving destroy. releasePressed emits key-ups only "
|
||||
"(VirtualKeyboard.cpp), which is why release_all sends "
|
||||
"modifiers(0,0,0,0) regardless."
|
||||
)
|
||||
say(
|
||||
" The confirming evidence is the cleanup below: "
|
||||
"onKeyboardKey DROPS a release whose code is not in the seat's "
|
||||
f"m_pressed, so a `key code={KEY_A} state=0` arriving from a BRAND "
|
||||
"NEW keyboard means the code was still in that set after destroy. A "
|
||||
"driver killed with -9 leaves it there and the next driver's press "
|
||||
"of it is dropped: dead, not merely stuck. _lift_everything is the "
|
||||
"only guard on the clean path and SIGKILL skips it."
|
||||
)
|
||||
|
||||
# Required cleanup, and it is the review's step 7: a NEW virtual keyboard,
|
||||
|
||||
Reference in new issue
Block a user