diff options
author | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-03-21 17:37:17 -0600 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2022-03-23 13:08:41 +0000 |
commit | 4519117a6885736b26f2d8ff1af97886d184c155 (patch) | |
tree | bed18c61f44f77412585c5be6410a21fc6c7acd3 /tinywl | |
parent | 4cc2a03620b55113622379772c0b8890010fe7fa (diff) |
seat: take wlr_keyboard in wlr_seat_set_keyboard()
Signed-off-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
Diffstat (limited to 'tinywl')
-rw-r--r-- | tinywl/tinywl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c index da965c4c..290dd094 100644 --- a/tinywl/tinywl.c +++ b/tinywl/tinywl.c @@ -91,7 +91,7 @@ struct tinywl_view { struct tinywl_keyboard { struct wl_list link; struct tinywl_server *server; - struct wlr_input_device *device; + struct wlr_keyboard *wlr_keyboard; struct wl_listener modifiers; struct wl_listener key; @@ -149,10 +149,10 @@ static void keyboard_handle_modifiers( * same seat. You can swap out the underlying wlr_keyboard like this and * wlr_seat handles this transparently. */ - wlr_seat_set_keyboard(keyboard->server->seat, keyboard->device); + wlr_seat_set_keyboard(keyboard->server->seat, keyboard->wlr_keyboard); /* Send modifiers to the client. */ wlr_seat_keyboard_notify_modifiers(keyboard->server->seat, - &keyboard->device->keyboard->modifiers); + &keyboard->wlr_keyboard->modifiers); } static bool handle_keybinding(struct tinywl_server *server, xkb_keysym_t sym) { @@ -196,10 +196,10 @@ static void keyboard_handle_key( /* Get a list of keysyms based on the keymap for this keyboard */ const xkb_keysym_t *syms; int nsyms = xkb_state_key_get_syms( - keyboard->device->keyboard->xkb_state, keycode, &syms); + keyboard->wlr_keyboard->xkb_state, keycode, &syms); bool handled = false; - uint32_t modifiers = wlr_keyboard_get_modifiers(keyboard->device->keyboard); + uint32_t modifiers = wlr_keyboard_get_modifiers(keyboard->wlr_keyboard); if ((modifiers & WLR_MODIFIER_ALT) && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) { /* If alt is held down and this button was _pressed_, we attempt to @@ -211,7 +211,7 @@ static void keyboard_handle_key( if (!handled) { /* Otherwise, we pass it along to the client. */ - wlr_seat_set_keyboard(seat, keyboard->device); + wlr_seat_set_keyboard(seat, keyboard->wlr_keyboard); wlr_seat_keyboard_notify_key(seat, event->time_msec, event->keycode, event->state); } @@ -236,7 +236,7 @@ static void server_new_keyboard(struct tinywl_server *server, struct tinywl_keyboard *keyboard = calloc(1, sizeof(struct tinywl_keyboard)); keyboard->server = server; - keyboard->device = device; + keyboard->wlr_keyboard = device->keyboard; /* We need to prepare an XKB keymap and assign it to the keyboard. This * assumes the defaults (e.g. layout = "us"). */ @@ -257,7 +257,7 @@ static void server_new_keyboard(struct tinywl_server *server, keyboard->destroy.notify = keyboard_handle_destroy; wl_signal_add(&device->events.destroy, &keyboard->destroy); - wlr_seat_set_keyboard(server->seat, device); + wlr_seat_set_keyboard(server->seat, keyboard->wlr_keyboard); /* And add the keyboard to our list of keyboards */ wl_list_insert(&server->keyboards, &keyboard->link); |