Files
hyprland-headless-stream-pl…/tests/keyboard-probe-2026-10-04.txt
T
HermenixandClaude Opus 5 b1f2744cf0 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
2026-10-04 03:46:53 +00:00

142 lines
8.1 KiB
Plaintext

keyboard_probe.py, 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. Verbatim; nothing edited.
=== 1. globals on this compositor ===
global ext_background_effect_manager_v1 v1
global ext_data_control_manager_v1 v1
global ext_foreign_toplevel_image_capture_source_manager_v1 v1
global ext_foreign_toplevel_list_v1 v1
global ext_idle_notifier_v1 v2
global ext_image_copy_capture_manager_v1 v1
global ext_output_image_capture_source_manager_v1 v1
global ext_session_lock_manager_v1 v1
global ext_workspace_manager_v1 v1
global hyprland_ctm_control_manager_v1 v2
global hyprland_focus_grab_manager_v1 v1
global hyprland_global_shortcuts_manager_v1 v1
global hyprland_input_capture_manager_v1 v1
global hyprland_lock_notifier_v1 v1
global hyprland_surface_manager_v1 v2
global hyprland_toplevel_export_manager_v1 v2
global hyprland_toplevel_mapping_manager_v1 v1
global org_kde_kwin_server_decoration_manager v1
global vicinae_hotkey_manager_v1 v1
global wl_compositor v6
global wl_data_device_manager v3
global wl_drm v2
global wl_output v4
global wl_seat v9
global wl_shm v2
global wl_subcompositor v1
global wp_alpha_modifier_v1 v1
global wp_color_manager_v1 v3
global wp_commit_timing_manager_v1 v1
global wp_content_type_manager_v1 v1
global wp_cursor_shape_manager_v1 v2
global wp_drm_lease_device_v1 v1
global wp_fifo_manager_v1 v1
global wp_fractional_scale_manager_v1 v1
global wp_pointer_warp_v1 v1
global wp_presentation v2
global wp_security_context_manager_v1 v1
global wp_single_pixel_buffer_manager_v1 v1
global wp_tearing_control_manager_v1 v1
global wp_viewporter v1
global xdg_activation_v1 v1
global xdg_system_bell_v1 v1
global xdg_toplevel_tag_manager_v1 v1
global xdg_wm_base v7
global xdg_wm_dialog_v1 v1
global xwayland_shell_v1 v1
global zwlr_data_control_manager_v1 v2
global zwlr_foreign_toplevel_manager_v1 v3
global zwlr_gamma_control_manager_v1 v1
global zwlr_layer_shell_v1 v5
global zwlr_output_manager_v1 v4
global zwlr_output_power_manager_v1 v1
global zwlr_screencopy_manager_v1 v3
global zwlr_virtual_pointer_manager_v1 v2
global zwp_idle_inhibit_manager_v1 v1
global zwp_input_method_manager_v2 v1
global zwp_keyboard_shortcuts_inhibit_manager_v1 v1
global zwp_linux_dmabuf_v1 v5
global zwp_pointer_constraints_v1 v1
global zwp_pointer_gestures_v1 v3
global zwp_primary_selection_device_manager_v1 v1
global zwp_relative_pointer_manager_v1 v1
global zwp_tablet_manager_v2 v1
global zwp_text_input_manager_v1 v1
global zwp_text_input_manager_v3 v1
global zwp_virtual_keyboard_manager_v1 v1
global zxdg_decoration_manager_v1 v2
global zxdg_exporter_v2 v1
global zxdg_importer_v2 v1
global zxdg_output_manager_v1 v3
ANSWER 1: zwp_virtual_keyboard_manager_v1 is present at version 1.
zwlr_virtual_pointer_manager_v1 v2 (needed for (a)).
setup -> seat capabilities=1
setup -> seat capabilities=3
setup -> uploaded keymap format=1 size=35572
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=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=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
=== (a) does a virtual-pointer warp move wl_keyboard focus? ===
options this measurement depends on:
input:follow_mouse = {"int": 1, "option": "input:follow_mouse", "set": true}
input:follow_mouse_threshold = {"float": 0.0, "option": "input:follow_mouse_threshold", "set": false}
input:virtualkeyboard:release_pressed_on_close = {"int": 0, "option": "input:virtualkeyboard:release_pressed_on_close", "set": false}
input:repeat_rate = {"int": 25, "option": "input:repeat_rate", "set": false}
input:repeat_delay = {"int": 600, "option": "input:repeat_delay", "set": false}
input:kb_layout = {"option": "input:kb_layout", "set": false, "str": "us"}
output Virtual-1 mode 1280x720
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
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
press_count=1 repeat_info=(25, 600)
ANSWER (c): press_count=1 — the compositor does not repeat on the wire; it published repeat_info (25, 600) and the CLIENT repeats. This is NOT 'keyboard down will not flood a text field': foot/GTK/Qt will insert characters from this one press until the key-up or the lease TTL. The help text must warn unconditionally.
(key code=30 deliberately left down, for (b))
=== (b) does destroying the virtual keyboard release a held key? ===
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 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
cleanup=sent
Done. Nothing here touched the broker, the lease or any session.