diff options
author | 2024-05-24 23:53:46 +0200 | |
---|---|---|
committer | 2024-05-27 09:27:45 -0400 | |
commit | df69367d927e6d4fde70d61611c9317b70537261 (patch) | |
tree | 7e1ce1fd17a8f3f2e08815c61ec07084004b9b4e | |
parent | server: hide xdg_output from unprivileged clients (diff) | |
download | sway-df69367d927e6d4fde70d61611c9317b70537261.tar.gz sway-df69367d927e6d4fde70d61611c9317b70537261.tar.zst sway-df69367d927e6d4fde70d61611c9317b70537261.zip |
input/text_input: ensure keyboard is set before sending modifiers
Clients get confused when modifier events are sent before the
keymap.
-rw-r--r-- | sway/input/text_input.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/input/text_input.c b/sway/input/text_input.c index c38a3bb2..ba8c0b99 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c | |||
@@ -66,11 +66,13 @@ static void handle_im_keyboard_grab_destroy(struct wl_listener *listener, void * | |||
66 | struct sway_input_method_relay *relay = wl_container_of(listener, relay, | 66 | struct sway_input_method_relay *relay = wl_container_of(listener, relay, |
67 | input_method_keyboard_grab_destroy); | 67 | input_method_keyboard_grab_destroy); |
68 | struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = data; | 68 | struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = data; |
69 | struct wlr_seat *wlr_seat = keyboard_grab->input_method->seat; | ||
69 | wl_list_remove(&relay->input_method_keyboard_grab_destroy.link); | 70 | wl_list_remove(&relay->input_method_keyboard_grab_destroy.link); |
70 | 71 | ||
71 | if (keyboard_grab->keyboard) { | 72 | if (keyboard_grab->keyboard) { |
72 | // send modifier state to original client | 73 | // send modifier state to original client |
73 | wlr_seat_keyboard_notify_modifiers(keyboard_grab->input_method->seat, | 74 | wlr_seat_set_keyboard(wlr_seat, keyboard_grab->keyboard); |
75 | wlr_seat_keyboard_notify_modifiers(wlr_seat, | ||
74 | &keyboard_grab->keyboard->modifiers); | 76 | &keyboard_grab->keyboard->modifiers); |
75 | } | 77 | } |
76 | } | 78 | } |