mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
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.
This commit is contained in:
parent
5c4384a133
commit
91943a68a6
31 changed files with 216 additions and 130 deletions
|
|
@ -228,22 +228,22 @@ struct libinput_device *wlr_libinput_get_device_handle(
|
|||
struct wlr_libinput_input_device *dev = NULL;
|
||||
switch (wlr_dev->type) {
|
||||
case WLR_INPUT_DEVICE_KEYBOARD:
|
||||
dev = device_from_keyboard(wlr_dev->keyboard);
|
||||
dev = device_from_keyboard(wlr_keyboard_from_input_device(wlr_dev));
|
||||
break;
|
||||
case WLR_INPUT_DEVICE_POINTER:
|
||||
dev = device_from_pointer(wlr_dev->pointer);
|
||||
dev = device_from_pointer(wlr_pointer_from_input_device(wlr_dev));
|
||||
break;
|
||||
case WLR_INPUT_DEVICE_SWITCH:
|
||||
dev = device_from_switch(wlr_dev->switch_device);
|
||||
dev = device_from_switch(wlr_switch_from_input_device(wlr_dev));
|
||||
break;
|
||||
case WLR_INPUT_DEVICE_TOUCH:
|
||||
dev = device_from_touch(wlr_dev->touch);
|
||||
dev = device_from_touch(wlr_touch_from_input_device(wlr_dev));
|
||||
break;
|
||||
case WLR_INPUT_DEVICE_TABLET_TOOL:
|
||||
dev = device_from_tablet(wlr_dev->tablet);
|
||||
dev = device_from_tablet(wlr_tablet_from_input_device(wlr_dev));
|
||||
break;
|
||||
case WLR_INPUT_DEVICE_TABLET_PAD:
|
||||
dev = device_from_tablet_pad(wlr_dev->tablet_pad);
|
||||
dev = device_from_tablet_pad(wlr_tablet_pad_from_input_device(wlr_dev));
|
||||
break;
|
||||
}
|
||||
return dev->handle;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue