diff options
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/keyboard.c | 2 | ||||
-rw-r--r-- | sway/input/seat.c | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index e7539c48..5827a1ca 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -401,7 +401,7 @@ static void handle_keyboard_modifiers(struct wl_listener *listener, | |||
401 | struct wlr_input_device *wlr_device = | 401 | struct wlr_input_device *wlr_device = |
402 | keyboard->seat_device->input_device->wlr_device; | 402 | keyboard->seat_device->input_device->wlr_device; |
403 | wlr_seat_set_keyboard(wlr_seat, wlr_device); | 403 | wlr_seat_set_keyboard(wlr_seat, wlr_device); |
404 | wlr_seat_keyboard_notify_modifiers(wlr_seat); | 404 | wlr_seat_keyboard_notify_modifiers(wlr_seat, &wlr_device->keyboard->modifiers); |
405 | } | 405 | } |
406 | 406 | ||
407 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, | 407 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 268486ab..d24a6c7a 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -67,13 +67,16 @@ static void seat_configure_keyboard(struct sway_seat *seat, | |||
67 | if (!seat_device->keyboard) { | 67 | if (!seat_device->keyboard) { |
68 | sway_keyboard_create(seat, seat_device); | 68 | sway_keyboard_create(seat, seat_device); |
69 | } | 69 | } |
70 | struct wlr_keyboard *wlr_keyboard = seat_device->input_device->wlr_device->keyboard; | ||
70 | sway_keyboard_configure(seat_device->keyboard); | 71 | sway_keyboard_configure(seat_device->keyboard); |
71 | wlr_seat_set_keyboard(seat->wlr_seat, | 72 | wlr_seat_set_keyboard(seat->wlr_seat, |
72 | seat_device->input_device->wlr_device); | 73 | seat_device->input_device->wlr_device); |
73 | if (seat->focus) { | 74 | if (seat->focus) { |
74 | // force notify reenter to pick up the new configuration | 75 | // force notify reenter to pick up the new configuration |
75 | wlr_seat_keyboard_clear_focus(seat->wlr_seat); | 76 | wlr_seat_keyboard_clear_focus(seat->wlr_seat); |
76 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, seat->focus->sway_view->surface); | 77 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, |
78 | seat->focus->sway_view->surface, wlr_keyboard->keycodes, | ||
79 | wlr_keyboard->num_keycodes, &wlr_keyboard->modifiers); | ||
77 | } | 80 | } |
78 | } | 81 | } |
79 | 82 | ||
@@ -214,7 +217,16 @@ void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) { | |||
214 | view->iface.set_activated(view, true); | 217 | view->iface.set_activated(view, true); |
215 | wl_signal_add(&container->events.destroy, &seat->focus_destroy); | 218 | wl_signal_add(&container->events.destroy, &seat->focus_destroy); |
216 | seat->focus_destroy.notify = handle_focus_destroy; | 219 | seat->focus_destroy.notify = handle_focus_destroy; |
217 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface); | 220 | |
221 | struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat); | ||
222 | if (keyboard) { | ||
223 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface, | ||
224 | keyboard->keycodes, keyboard->num_keycodes, | ||
225 | &keyboard->modifiers); | ||
226 | } else { | ||
227 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface, | ||
228 | NULL, 0, NULL); | ||
229 | } | ||
218 | } | 230 | } |
219 | 231 | ||
220 | seat->focus = container; | 232 | seat->focus = container; |