aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-17 11:53:27 -0500
committerGitHub <noreply@github.com>2018-01-17 11:53:27 -0500
commit3dd915876d459a2aeeb7a5864330f5bc30bc2f00 (patch)
treedc1245cb2e6cdd4bbcd9921d668b36e4bcd00672
parenteb0f432a840dbe860b8c20f7a16e0281f9026326 (diff)
parent2bf76509f8fab86c166a35689223d9eeab0f654f (diff)
Merge pull request #1571 from acrisci/wlroots-modifiers-update
update for new wlr-keyboard modifiers
-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;