diff options
author | Isaac Freund <mail@isaacfreund.com> | 2022-06-20 16:57:29 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-06-21 18:42:07 +0000 |
commit | 91943a68a6976ef7c4cc70afc07954a00fae678b (patch) | |
tree | 4202f4951479425da05e387604266de73b91a2f8 /tinywl | |
parent | 5c4384a1330faedf975c8b8644881d50390f3613 (diff) |
wlr_input_device: remove anon union field
This union is unnecessary since the recent input device refactor and can
now be replaced by wlr_*_from_input_device() functions.
Diffstat (limited to 'tinywl')
-rw-r--r-- | tinywl/tinywl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c index f96fe791..2b58a4b5 100644 --- a/tinywl/tinywl.c +++ b/tinywl/tinywl.c @@ -238,10 +238,12 @@ static void keyboard_handle_destroy(struct wl_listener *listener, void *data) { static void server_new_keyboard(struct tinywl_server *server, struct wlr_input_device *device) { + struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(device); + struct tinywl_keyboard *keyboard = calloc(1, sizeof(struct tinywl_keyboard)); keyboard->server = server; - keyboard->wlr_keyboard = device->keyboard; + keyboard->wlr_keyboard = wlr_keyboard; /* We need to prepare an XKB keymap and assign it to the keyboard. This * assumes the defaults (e.g. layout = "us"). */ @@ -249,16 +251,16 @@ static void server_new_keyboard(struct tinywl_server *server, struct xkb_keymap *keymap = xkb_keymap_new_from_names(context, NULL, XKB_KEYMAP_COMPILE_NO_FLAGS); - wlr_keyboard_set_keymap(device->keyboard, keymap); + wlr_keyboard_set_keymap(wlr_keyboard, keymap); xkb_keymap_unref(keymap); xkb_context_unref(context); - wlr_keyboard_set_repeat_info(device->keyboard, 25, 600); + wlr_keyboard_set_repeat_info(wlr_keyboard, 25, 600); /* Here we set up listeners for keyboard events. */ keyboard->modifiers.notify = keyboard_handle_modifiers; - wl_signal_add(&device->keyboard->events.modifiers, &keyboard->modifiers); + wl_signal_add(&wlr_keyboard->events.modifiers, &keyboard->modifiers); keyboard->key.notify = keyboard_handle_key; - wl_signal_add(&device->keyboard->events.key, &keyboard->key); + wl_signal_add(&wlr_keyboard->events.key, &keyboard->key); keyboard->destroy.notify = keyboard_handle_destroy; wl_signal_add(&device->events.destroy, &keyboard->destroy); |