diff options
Diffstat (limited to 'sway/input/switch.c')
-rw-r--r-- | sway/input/switch.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/input/switch.c b/sway/input/switch.c index ac4baece..fc7dfaff 100644 --- a/sway/input/switch.c +++ b/sway/input/switch.c | |||
@@ -11,6 +11,7 @@ struct sway_switch *sway_switch_create(struct sway_seat *seat, | |||
11 | return NULL; | 11 | return NULL; |
12 | } | 12 | } |
13 | device->switch_device = switch_device; | 13 | device->switch_device = switch_device; |
14 | switch_device->wlr = wlr_switch_from_input_device(device->input_device->wlr_device); | ||
14 | switch_device->seat_device = device; | 15 | switch_device->seat_device = device; |
15 | switch_device->state = WLR_SWITCH_STATE_OFF; | 16 | switch_device->state = WLR_SWITCH_STATE_OFF; |
16 | wl_list_init(&switch_device->switch_toggle.link); | 17 | wl_list_init(&switch_device->switch_toggle.link); |
@@ -95,10 +96,8 @@ static void handle_switch_toggle(struct wl_listener *listener, void *data) { | |||
95 | } | 96 | } |
96 | 97 | ||
97 | void sway_switch_configure(struct sway_switch *sway_switch) { | 98 | void sway_switch_configure(struct sway_switch *sway_switch) { |
98 | struct wlr_input_device *wlr_device = | ||
99 | sway_switch->seat_device->input_device->wlr_device; | ||
100 | wl_list_remove(&sway_switch->switch_toggle.link); | 99 | wl_list_remove(&sway_switch->switch_toggle.link); |
101 | wl_signal_add(&wlr_device->switch_device->events.toggle, | 100 | wl_signal_add(&sway_switch->wlr->events.toggle, |
102 | &sway_switch->switch_toggle); | 101 | &sway_switch->switch_toggle); |
103 | sway_switch->switch_toggle.notify = handle_switch_toggle; | 102 | sway_switch->switch_toggle.notify = handle_switch_toggle; |
104 | sway_log(SWAY_DEBUG, "Configured switch for device"); | 103 | sway_log(SWAY_DEBUG, "Configured switch for device"); |