]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Revert "keyboard: cancel repeat when handling key-bind"
authorJohan Malm <jgm323@gmail.com>
Mon, 11 Jul 2022 16:05:08 +0000 (17:05 +0100)
committerJohan Malm <jgm323@gmail.com>
Tue, 20 Sep 2022 19:52:48 +0000 (20:52 +0100)
This reverts commit e62bb51bfb33ee520e800cf98553d766824fe9cf.

Fixes #510

include/key-state.h
src/key-state.c
src/keyboard.c

index e5f72919e6c597a7fc530b62d61af229ed7cbaa9..1e7e5410c9edd0e7b14a5d8b57d5dc2b6ad19078 100644 (file)
@@ -5,8 +5,6 @@
 void key_state_set_pressed(uint32_t keycode, bool ispressed);
 void key_state_store_pressed_keys_as_bound(void);
 bool key_state_corresponding_press_event_was_bound(uint32_t keycode);
-
-/* returns numbers of keys still pressed in a consumed key combination */
-int key_state_bound_key_remove(uint32_t keycode);
+void key_state_bound_key_remove(uint32_t keycode);
 
 #endif /* __LABWC_KEY_STATE_H */
index d2be54671cdb3279d930044983b339cc9c6a6678..bc4844f6dcb6836fb9f83dde9ba5595b01832e8e 100644 (file)
@@ -63,9 +63,8 @@ key_state_corresponding_press_event_was_bound(uint32_t keycode)
        return false;
 }
 
-int
+void
 key_state_bound_key_remove(uint32_t keycode)
 {
        remove_key(&bound, keycode);
-       return bound.nr_keys;
 }
index 2f0dd66d886a1221cf9316ae05a4577a4c2424e5..1b033a41089bc5e1a244fa74970f4f00aae1fd09 100644 (file)
@@ -67,14 +67,12 @@ static bool
 handle_keybinding(struct server *server, uint32_t modifiers, xkb_keysym_t sym)
 {
        struct keybind *keybind;
-       struct wlr_keyboard *kb = &server->seat.keyboard_group->keyboard;
        wl_list_for_each_reverse (keybind, &rc.keybinds, link) {
                if (modifiers ^ keybind->modifiers) {
                        continue;
                }
                for (size_t i = 0; i < keybind->keysyms_len; i++) {
                        if (xkb_keysym_to_lower(sym) == keybind->keysyms[i]) {
-                               wlr_keyboard_set_repeat_info(kb, 0, 0);
                                actions_run(NULL, server, &keybind->actions, 0);
                                return true;
                        }
@@ -120,11 +118,7 @@ handle_compositor_keybindings(struct wl_listener *listener,
         */
        if (key_state_corresponding_press_event_was_bound(keycode)
                        && event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
-               int nr_bound_keys = key_state_bound_key_remove(keycode);
-               if (!nr_bound_keys) {
-                       wlr_keyboard_set_repeat_info(keyboard,
-                               rc.repeat_rate, rc.repeat_delay);
-               }
+               key_state_bound_key_remove(keycode);
                return true;
        }