From 5eefda1ffe16bdacd3445259937cfed119409e22 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Wed, 23 Feb 2022 10:42:20 -0500 Subject: backend/libinput: rework keyboard interface The wlr_libinput_input_device now owns its wlr_keyboard, instead of creating a new wlr_libinput_input_device for it. --- backend/libinput/backend.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'backend/libinput/backend.c') diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 50726ec5..bdc36591 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -238,8 +238,16 @@ struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display, struct libinput_device *wlr_libinput_get_device_handle( struct wlr_input_device *wlr_dev) { - struct wlr_libinput_input_device *dev = - (struct wlr_libinput_input_device *)wlr_dev; + struct wlr_libinput_input_device *dev = NULL; + switch (wlr_dev->type) { + case WLR_INPUT_DEVICE_KEYBOARD: + dev = device_from_keyboard(wlr_dev->keyboard); + break; + default: + dev = (struct wlr_libinput_input_device *)wlr_dev; + break; + } + return dev->handle; } -- cgit v1.2.3