aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/touch.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-06-08 17:21:07 +0200
committerSimon Ser <contact@emersion.fr>2023-06-14 15:20:41 +0200
commit2d9659d765b9da1a0ad3d7ea4a064ba08eee6260 (patch)
treef3bdab537823ee6ad7849f558a09b0efd26a9552 /backend/libinput/touch.c
parente1c6801b652ff792e54ffee75b0804a185f1cc9d (diff)
backend/libinput: use struct initializers for events
This is more readable and consistent with the rest of wlroots.
Diffstat (limited to 'backend/libinput/touch.c')
-rw-r--r--backend/libinput/touch.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c
index 3316754e..14713b5b 100644
--- a/backend/libinput/touch.c
+++ b/backend/libinput/touch.c
@@ -45,11 +45,11 @@ void handle_touch_up(struct libinput_event *event,
struct wlr_touch *touch) {
struct libinput_event_touch *tevent =
libinput_event_get_touch_event(event);
- struct wlr_touch_up_event wlr_event = { 0 };
- wlr_event.touch = touch;
- wlr_event.time_msec =
- usec_to_msec(libinput_event_touch_get_time_usec(tevent));
- wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
+ struct wlr_touch_up_event wlr_event = {
+ .touch = touch,
+ .time_msec = usec_to_msec(libinput_event_touch_get_time_usec(tevent)),
+ .touch_id = libinput_event_touch_get_seat_slot(tevent),
+ };
wl_signal_emit_mutable(&touch->events.up, &wlr_event);
}
@@ -57,13 +57,13 @@ void handle_touch_motion(struct libinput_event *event,
struct wlr_touch *touch) {
struct libinput_event_touch *tevent =
libinput_event_get_touch_event(event);
- struct wlr_touch_motion_event wlr_event = { 0 };
- wlr_event.touch = touch;
- wlr_event.time_msec =
- usec_to_msec(libinput_event_touch_get_time_usec(tevent));
- wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
- wlr_event.x = libinput_event_touch_get_x_transformed(tevent, 1);
- wlr_event.y = libinput_event_touch_get_y_transformed(tevent, 1);
+ struct wlr_touch_motion_event wlr_event = {
+ .touch = touch,
+ .time_msec = usec_to_msec(libinput_event_touch_get_time_usec(tevent)),
+ .touch_id = libinput_event_touch_get_seat_slot(tevent),
+ .x = libinput_event_touch_get_x_transformed(tevent, 1),
+ .y = libinput_event_touch_get_y_transformed(tevent, 1),
+ };
wl_signal_emit_mutable(&touch->events.motion, &wlr_event);
}
@@ -71,11 +71,11 @@ void handle_touch_cancel(struct libinput_event *event,
struct wlr_touch *touch) {
struct libinput_event_touch *tevent =
libinput_event_get_touch_event(event);
- struct wlr_touch_cancel_event wlr_event = { 0 };
- wlr_event.touch = touch;
- wlr_event.time_msec =
- usec_to_msec(libinput_event_touch_get_time_usec(tevent));
- wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
+ struct wlr_touch_cancel_event wlr_event = {
+ .touch = touch,
+ .time_msec = usec_to_msec(libinput_event_touch_get_time_usec(tevent)),
+ .touch_id = libinput_event_touch_get_seat_slot(tevent),
+ };
wl_signal_emit_mutable(&touch->events.cancel, &wlr_event);
}