aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/events.c
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2022-06-20 16:57:29 +0200
committerSimon Ser <contact@emersion.fr>2022-06-21 18:42:07 +0000
commit91943a68a6976ef7c4cc70afc07954a00fae678b (patch)
tree4202f4951479425da05e387604266de73b91a2f8 /backend/libinput/events.c
parent5c4384a1330faedf975c8b8644881d50390f3613 (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 'backend/libinput/events.c')
-rw-r--r--backend/libinput/events.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index e52dbd95..b9f2f43c 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -41,17 +41,23 @@ void destroy_libinput_input_device(struct wlr_libinput_input_device *dev) {
bool wlr_input_device_is_libinput(struct wlr_input_device *wlr_dev) {
switch (wlr_dev->type) {
case WLR_INPUT_DEVICE_KEYBOARD:
- return wlr_dev->keyboard->impl == &libinput_keyboard_impl;
+ return wlr_keyboard_from_input_device(wlr_dev)->impl ==
+ &libinput_keyboard_impl;
case WLR_INPUT_DEVICE_POINTER:
- return wlr_dev->pointer->impl == &libinput_pointer_impl;
+ return wlr_pointer_from_input_device(wlr_dev)->impl ==
+ &libinput_pointer_impl;
case WLR_INPUT_DEVICE_TOUCH:
- return wlr_dev->touch->impl == &libinput_touch_impl;
+ return wlr_touch_from_input_device(wlr_dev)->impl ==
+ &libinput_touch_impl;
case WLR_INPUT_DEVICE_TABLET_TOOL:
- return wlr_dev->tablet->impl == &libinput_tablet_impl;
+ return wlr_tablet_from_input_device(wlr_dev)-> impl ==
+ &libinput_tablet_impl;
case WLR_INPUT_DEVICE_TABLET_PAD:
- return wlr_dev->tablet_pad->impl == &libinput_tablet_pad_impl;
+ return wlr_tablet_pad_from_input_device(wlr_dev)->impl ==
+ &libinput_tablet_pad_impl;
case WLR_INPUT_DEVICE_SWITCH:
- return wlr_dev->switch_device->impl == &libinput_switch_impl;
+ return wlr_switch_from_input_device(wlr_dev)->impl ==
+ &libinput_switch_impl;
default:
return false;
}