aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sway/input/keyboard.c2
-rw-r--r--sway/input/seat.c16
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,
struct wlr_input_device *wlr_device =
keyboard->seat_device->input_device->wlr_device;
wlr_seat_set_keyboard(wlr_seat, wlr_device);
- wlr_seat_keyboard_notify_modifiers(wlr_seat);
+ wlr_seat_keyboard_notify_modifiers(wlr_seat, &wlr_device->keyboard->modifiers);
}
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,
if (!seat_device->keyboard) {
sway_keyboard_create(seat, seat_device);
}
+ struct wlr_keyboard *wlr_keyboard = seat_device->input_device->wlr_device->keyboard;
sway_keyboard_configure(seat_device->keyboard);
wlr_seat_set_keyboard(seat->wlr_seat,
seat_device->input_device->wlr_device);
if (seat->focus) {
// force notify reenter to pick up the new configuration
wlr_seat_keyboard_clear_focus(seat->wlr_seat);
- wlr_seat_keyboard_notify_enter(seat->wlr_seat, seat->focus->sway_view->surface);
+ wlr_seat_keyboard_notify_enter(seat->wlr_seat,
+ seat->focus->sway_view->surface, wlr_keyboard->keycodes,
+ wlr_keyboard->num_keycodes, &wlr_keyboard->modifiers);
}
}
@@ -214,7 +217,16 @@ void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) {
view->iface.set_activated(view, true);
wl_signal_add(&container->events.destroy, &seat->focus_destroy);
seat->focus_destroy.notify = handle_focus_destroy;
- wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface);
+
+ struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat);
+ if (keyboard) {
+ wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface,
+ keyboard->keycodes, keyboard->num_keycodes,
+ &keyboard->modifiers);
+ } else {
+ wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface,
+ NULL, 0, NULL);
+ }
}
seat->focus = container;