diff options
Diffstat (limited to 'backend/libinput/switch.c')
-rw-r--r-- | backend/libinput/switch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/libinput/switch.c b/backend/libinput/switch.c index e8c68bef..61bb887f 100644 --- a/backend/libinput/switch.c +++ b/backend/libinput/switch.c @@ -28,7 +28,9 @@ void handle_switch_toggle(struct libinput_event *event, struct wlr_switch *wlr_switch) { struct libinput_event_switch *sevent = libinput_event_get_switch_event (event); - struct wlr_switch_toggle_event wlr_event = { 0 }; + struct wlr_switch_toggle_event wlr_event = { + .time_msec = usec_to_msec(libinput_event_switch_get_time_usec(sevent)), + }; switch (libinput_event_switch_get_switch(sevent)) { case LIBINPUT_SWITCH_LID: wlr_event.switch_type = WLR_SWITCH_TYPE_LID; @@ -45,7 +47,5 @@ void handle_switch_toggle(struct libinput_event *event, wlr_event.switch_state = WLR_SWITCH_STATE_ON; break; } - wlr_event.time_msec = - usec_to_msec(libinput_event_switch_get_time_usec(sevent)); wl_signal_emit_mutable(&wlr_switch->events.toggle, &wlr_event); } |