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 634d8981..ea2cc038 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -593,6 +593,13 @@ void input_manager_reset_input(struct sway_input_device *input_device) { | |||
593 | } | 593 | } |
594 | 594 | ||
595 | void input_manager_reset_all_inputs(void) { | 595 | void input_manager_reset_all_inputs(void) { |
596 | // Set the active keyboard to NULL to avoid spamming configuration updates | ||
597 | // for all keyboard devices. | ||
598 | struct sway_seat *seat; | ||
599 | wl_list_for_each(seat, &server.input->seats, link) { | ||
600 | wlr_seat_set_keyboard(seat->wlr_seat, NULL); | ||
601 | } | ||
602 | |||
596 | struct sway_input_device *input_device = NULL; | 603 | struct sway_input_device *input_device = NULL; |
597 | wl_list_for_each(input_device, &server.input->devices, link) { | 604 | wl_list_for_each(input_device, &server.input->devices, link) { |
598 | input_manager_reset_input(input_device); | 605 | input_manager_reset_input(input_device); |
@@ -601,7 +608,6 @@ void input_manager_reset_all_inputs(void) { | |||
601 | // If there is at least one keyboard using the default keymap, repeat delay, | 608 | // If there is at least one keyboard using the default keymap, repeat delay, |
602 | // and repeat rate, then it is possible that there is a keyboard group that | 609 | // and repeat rate, then it is possible that there is a keyboard group that |
603 | // need their keyboard disarmed. | 610 | // need their keyboard disarmed. |
604 | struct sway_seat *seat; | ||
605 | wl_list_for_each(seat, &server.input->seats, link) { | 611 | wl_list_for_each(seat, &server.input->seats, link) { |
606 | struct sway_keyboard_group *group; | 612 | struct sway_keyboard_group *group; |
607 | wl_list_for_each(group, &seat->keyboard_groups, link) { | 613 | wl_list_for_each(group, &seat->keyboard_groups, link) { |
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 2ac02b22..96d5b72d 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -1070,9 +1070,6 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
1070 | } | 1070 | } |
1071 | } | 1071 | } |
1072 | 1072 | ||
1073 | struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat; | ||
1074 | wlr_seat_set_keyboard(seat, keyboard->wlr); | ||
1075 | |||
1076 | wl_list_remove(&keyboard->keyboard_key.link); | 1073 | wl_list_remove(&keyboard->keyboard_key.link); |
1077 | wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key); | 1074 | wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key); |
1078 | keyboard->keyboard_key.notify = handle_keyboard_key; | 1075 | keyboard->keyboard_key.notify = handle_keyboard_key; |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 4919bed0..151303a9 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -823,8 +823,15 @@ static void seat_configure_keyboard(struct sway_seat *seat, | |||
823 | sway_keyboard_create(seat, seat_device); | 823 | sway_keyboard_create(seat, seat_device); |
824 | } | 824 | } |
825 | sway_keyboard_configure(seat_device->keyboard); | 825 | sway_keyboard_configure(seat_device->keyboard); |
826 | wlr_seat_set_keyboard(seat->wlr_seat, | 826 | |
827 | wlr_keyboard_from_input_device(seat_device->input_device->wlr_device)); | 827 | // We only need to update the current keyboard, as the rest will be updated |
828 | // as they are activated. | ||
829 | struct wlr_keyboard *wlr_keyboard = | ||
830 | wlr_keyboard_from_input_device(seat_device->input_device->wlr_device); | ||
831 | struct wlr_keyboard *current_keyboard = seat->wlr_seat->keyboard_state.keyboard; | ||
832 | if (wlr_keyboard != current_keyboard) { | ||
833 | return; | ||
834 | } | ||
828 | 835 | ||
829 | // force notify reenter to pick up the new configuration. This reuses | 836 | // force notify reenter to pick up the new configuration. This reuses |
830 | // the current focused surface to avoid breaking input grabs. | 837 | // the current focused surface to avoid breaking input grabs. |