Remove access to wlr_input_device union

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3626
Closes: https://github.com/swaywm/sway/issues/7077
This commit is contained in:
Simon Ser 2022-06-21 23:10:38 +02:00 committed by Simon Zeni
parent 49cef51e6e
commit 122d8ce954
10 changed files with 76 additions and 92 deletions

View file

@ -11,6 +11,7 @@ struct sway_switch *sway_switch_create(struct sway_seat *seat,
return NULL;
}
device->switch_device = switch_device;
switch_device->wlr = wlr_switch_from_input_device(device->input_device->wlr_device);
switch_device->seat_device = device;
switch_device->state = WLR_SWITCH_STATE_OFF;
wl_list_init(&switch_device->switch_toggle.link);
@ -95,10 +96,8 @@ static void handle_switch_toggle(struct wl_listener *listener, void *data) {
}
void sway_switch_configure(struct sway_switch *sway_switch) {
struct wlr_input_device *wlr_device =
sway_switch->seat_device->input_device->wlr_device;
wl_list_remove(&sway_switch->switch_toggle.link);
wl_signal_add(&wlr_device->switch_device->events.toggle,
wl_signal_add(&sway_switch->wlr->events.toggle,
&sway_switch->switch_toggle);
sway_switch->switch_toggle.notify = handle_switch_toggle;
sway_log(SWAY_DEBUG, "Configured switch for device");