mirror of
https://github.com/swaywm/sway.git
synced 2026-04-18 06:46:56 -04:00
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:
parent
49cef51e6e
commit
122d8ce954
10 changed files with 76 additions and 92 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue