diff options
-rw-r--r-- | sway/input/input-manager.c | 8 | ||||
-rw-r--r-- | sway/input/keyboard.c | 3 | ||||
-rw-r--r-- | sway/input/seat.c | 11 |
3 files changed, 16 insertions, 6 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 26eefc8a..39f4b795 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -575,6 +575,13 @@ void input_manager_reset_input(struct sway_input_device *input_device) { | |||
575 | } | 575 | } |
576 | 576 | ||
577 | void input_manager_reset_all_inputs(void) { | 577 | void input_manager_reset_all_inputs(void) { |
578 | // Set the active keyboard to NULL to avoid spamming configuration updates | ||
579 | // for all keyboard devices. | ||
580 | struct sway_seat *seat; | ||
581 | wl_list_for_each(seat, &server.input->seats, link) { | ||
582 | wlr_seat_set_keyboard(seat->wlr_seat, NULL); | ||
583 | } | ||
584 | |||
578 | struct sway_input_device *input_device = NULL; | 585 | struct sway_input_device *input_device = NULL; |
579 | wl_list_for_each(input_device, &server.input->devices, link) { | 586 | wl_list_for_each(input_device, &server.input->devices, link) { |
580 | input_manager_reset_input(input_device); | 587 | input_manager_reset_input(input_device); |
@@ -583,7 +590,6 @@ void input_manager_reset_all_inputs(void) { | |||
583 | // If there is at least one keyboard using the default keymap, repeat delay, | 590 | // If there is at least one keyboard using the default keymap, repeat delay, |
584 | // and repeat rate, then it is possible that there is a keyboard group that | 591 | // and repeat rate, then it is possible that there is a keyboard group that |
585 | // need their keyboard disarmed. | 592 | // need their keyboard disarmed. |
586 | struct sway_seat *seat; | ||
587 | wl_list_for_each(seat, &server.input->seats, link) { | 593 | wl_list_for_each(seat, &server.input->seats, link) { |
588 | struct sway_keyboard_group *group; | 594 | struct sway_keyboard_group *group; |
589 | wl_list_for_each(group, &seat->keyboard_groups, link) { | 595 | wl_list_for_each(group, &seat->keyboard_groups, link) { |
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 5e5692f1..aedf3ae6 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -1068,9 +1068,6 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
1068 | } | 1068 | } |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat; | ||
1072 | wlr_seat_set_keyboard(seat, keyboard->wlr); | ||
1073 | |||
1074 | wl_list_remove(&keyboard->keyboard_key.link); | 1071 | wl_list_remove(&keyboard->keyboard_key.link); |
1075 | wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key); | 1072 | wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key); |
1076 | keyboard->keyboard_key.notify = handle_keyboard_key; | 1073 | keyboard->keyboard_key.notify = handle_keyboard_key; |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 43b20779..646f3866 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -814,8 +814,15 @@ static void seat_configure_keyboard(struct sway_seat *seat, | |||
814 | sway_keyboard_create(seat, seat_device); | 814 | sway_keyboard_create(seat, seat_device); |
815 | } | 815 | } |
816 | sway_keyboard_configure(seat_device->keyboard); | 816 | sway_keyboard_configure(seat_device->keyboard); |
817 | wlr_seat_set_keyboard(seat->wlr_seat, | 817 | |
818 | wlr_keyboard_from_input_device(seat_device->input_device->wlr_device)); | 818 | // We only need to update the current keyboard, as the rest will be updated |
819 | // as they are activated. | ||
820 | struct wlr_keyboard *wlr_keyboard = | ||
821 | wlr_keyboard_from_input_device(seat_device->input_device->wlr_device); | ||
822 | struct wlr_keyboard *current_keyboard = seat->wlr_seat->keyboard_state.keyboard; | ||
823 | if (wlr_keyboard != current_keyboard) { | ||
824 | return; | ||
825 | } | ||
819 | 826 | ||
820 | // force notify reenter to pick up the new configuration. This reuses | 827 | // force notify reenter to pick up the new configuration. This reuses |
821 | // the current focused surface to avoid breaking input grabs. | 828 | // the current focused surface to avoid breaking input grabs. |