chase wlroots input_device changes

This commit is contained in:
Leonardo Hernández Hernández 2022-06-21 16:25:18 -05:00
parent a32db11f16
commit 461d02d3e0
No known key found for this signature in database
GPG key ID: E538897EE11B9624

10
dwl.c
View file

@ -575,8 +575,7 @@ cleanup(void)
void void
cleanupkeyboard(struct wl_listener *listener, void *data) cleanupkeyboard(struct wl_listener *listener, void *data)
{ {
struct wlr_input_device *device = data; Keyboard *kb = wlr_keyboard_from_input_device(data)->data;
Keyboard *kb = device->keyboard->data;
wl_list_remove(&kb->link); wl_list_remove(&kb->link);
wl_list_remove(&kb->modifiers.link); wl_list_remove(&kb->modifiers.link);
@ -1118,10 +1117,10 @@ inputdevice(struct wl_listener *listener, void *data)
switch (device->type) { switch (device->type) {
case WLR_INPUT_DEVICE_KEYBOARD: case WLR_INPUT_DEVICE_KEYBOARD:
createkeyboard(device->keyboard); createkeyboard(wlr_keyboard_from_input_device(device));
break; break;
case WLR_INPUT_DEVICE_POINTER: case WLR_INPUT_DEVICE_POINTER:
createpointer(device->pointer); createpointer(wlr_pointer_from_input_device(device));
break; break;
default: default:
/* TODO handle other input device types */ /* TODO handle other input device types */
@ -2230,8 +2229,7 @@ void
virtualkeyboard(struct wl_listener *listener, void *data) virtualkeyboard(struct wl_listener *listener, void *data)
{ {
struct wlr_virtual_keyboard_v1 *keyboard = data; struct wlr_virtual_keyboard_v1 *keyboard = data;
struct wlr_input_device *device = &keyboard->keyboard.base; createkeyboard(&keyboard->keyboard);
createkeyboard(device->keyboard);
} }
Monitor * Monitor *