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:
Isaac Freund 2022-06-20 16:57:29 +02:00 committed by Simon Ser
parent 5c4384a133
commit 91943a68a6
31 changed files with 216 additions and 130 deletions

View file

@ -280,15 +280,15 @@ void destroy_wl_seats(struct wlr_wl_backend *wl) {
bool wlr_input_device_is_wl(struct wlr_input_device *dev) {
switch (dev->type) {
case WLR_INPUT_DEVICE_KEYBOARD:
return dev->keyboard->impl == &keyboard_impl;
return wlr_keyboard_from_input_device(dev)->impl == &keyboard_impl;
case WLR_INPUT_DEVICE_POINTER:
return dev->pointer->impl == &wl_pointer_impl;
return wlr_pointer_from_input_device(dev)->impl == &wl_pointer_impl;
case WLR_INPUT_DEVICE_TOUCH:
return dev->touch->impl == &touch_impl;
return wlr_touch_from_input_device(dev)->impl == &touch_impl;
case WLR_INPUT_DEVICE_TABLET_TOOL:
return dev->tablet->impl == &wl_tablet_impl;
return wlr_tablet_from_input_device(dev)-> impl == &wl_tablet_impl;
case WLR_INPUT_DEVICE_TABLET_PAD:
return dev->tablet_pad->impl == &wl_tablet_pad_impl;
return wlr_tablet_pad_from_input_device(dev)->impl == &wl_tablet_pad_impl;
default:
return false;
}