diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2024-09-08 17:28:34 +0530 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2024-09-08 17:28:34 +0530 |
| commit | ca9681b7c5accafb4c1f4f669d6d8f9ce5343bd4 (patch) | |
| tree | d62272fa3cf42ccf04e340e5a156df2b39689d83 | |
| parent | 63fe592d7e0d9de54b8969f5dbdf2c985d5fd71f (diff) | |
sway/input/keyboard: always set active keyboard if there is none
Previously, we incorrectly only set active keyboard for non-virtual
devices. 2498e694fb3aa99b3c863320d1bc936c334f241c incorrectly put
unrelated code in `sway_keyboard_set_layout`.
Fixes: 2498e694fb3aa99b3c863320d1bc936c334f241c
(cherry picked from commit c5ba7f23a50cd43d39fbb45274484abbcaa4e157)
| -rw-r--r-- | sway/input/keyboard.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index efb9ac39..1a73df01 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -1028,13 +1028,6 @@ static void sway_keyboard_set_layout(struct sway_keyboard *keyboard, } } - // If the seat has no active keyboard, set this one - struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat; - struct wlr_keyboard *current_keyboard = seat->keyboard_state.keyboard; - if (current_keyboard == NULL) { - wlr_seat_set_keyboard(seat, keyboard->wlr); - } - if (keymap_changed) { ipc_event_input("xkb_keymap", keyboard->seat_device->input_device); @@ -1078,6 +1071,13 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { sway_keyboard_set_layout(keyboard, input_config); } + // If the seat has no active keyboard, set this one + struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat; + struct wlr_keyboard *current_keyboard = seat->keyboard_state.keyboard; + if (current_keyboard == NULL) { + wlr_seat_set_keyboard(seat, keyboard->wlr); + } + wl_list_remove(&keyboard->keyboard_key.link); wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key); keyboard->keyboard_key.notify = handle_keyboard_key; |
