]> git.mdlowis.com Git - proto/labwc.git/commit
keyboard: fix key repeat bug on surface focus change
authorJohan Malm <jgm323@gmail.com>
Tue, 14 Nov 2023 18:57:40 +0000 (18:57 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 18 Nov 2023 14:17:25 +0000 (14:17 +0000)
commit2734302fd2e2571102e075bb97738a952a46b856
treed4578463df826b4b592663fe0779edfc47198c02
parentba76b26165f0d52dc33ce50ebc4f92580baf4e32
keyboard: fix key repeat bug on surface focus change

The bug can be reproduced by using the following keybinds and then taking
the steps below with an XWayland client, for example xterm:

    <keybind key="C-S-h">
      <action name="GoToDesktop" to="left" wrap="yes"/>
    </keybind>
    <keybind key="C-S-l">
      <action name="GoToDesktop" to="right" wrap="yes"/>
    </keybind>

1. Press C-S-h
2. Press C-S-l
3. Observe llllllll.... in xterm

Store the key-state in `handle_keybind()` before any call to
`action_run()` as this may lead to `seat_focus()` which passes
'pressed-sent' keys to the new surface.

This partially reverts 7571c4b, which as a standalone commit was fine, but
when 'pressed_mods' were then included in 'bound' in 98bf316,
`key_state_store_pressed_keys_as_bound()` was again required in
`handle_keybind()` to ensure modifers are not passed as non-modifiers in
`wlr_seat_keyboard_notify_enter()` in `seat_focus()`
src/input/keyboard.c