From c91469767631c84375678f3428a43c355d2c9742 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 27 Aug 2017 11:44:55 -0400 Subject: add device to touch events --- backend/libinput/touch.c | 4 ++++ include/wlr/types/wlr_touch.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c index 9e08d028..2f300482 100644 --- a/backend/libinput/touch.c +++ b/backend/libinput/touch.c @@ -30,6 +30,7 @@ void handle_touch_down(struct libinput_event *event, struct libinput_event_touch *tevent = libinput_event_get_touch_event(event); struct wlr_event_touch_down wlr_event = { 0 }; + wlr_event.device = wlr_dev; wlr_event.time_sec = libinput_event_touch_get_time(tevent); wlr_event.time_usec = libinput_event_touch_get_time_usec(tevent); wlr_event.slot = libinput_event_touch_get_slot(tevent); @@ -50,6 +51,7 @@ void handle_touch_up(struct libinput_event *event, struct libinput_event_touch *tevent = libinput_event_get_touch_event(event); struct wlr_event_touch_up wlr_event = { 0 }; + wlr_event.device = wlr_dev; wlr_event.time_sec = libinput_event_touch_get_time(tevent); wlr_event.time_usec = libinput_event_touch_get_time_usec(tevent); wlr_event.slot = libinput_event_touch_get_slot(tevent); @@ -67,6 +69,7 @@ void handle_touch_motion(struct libinput_event *event, struct libinput_event_touch *tevent = libinput_event_get_touch_event(event); struct wlr_event_touch_motion wlr_event = { 0 }; + wlr_event.device = wlr_dev; wlr_event.time_sec = libinput_event_touch_get_time(tevent); wlr_event.time_usec = libinput_event_touch_get_time_usec(tevent); wlr_event.slot = libinput_event_touch_get_slot(tevent); @@ -87,6 +90,7 @@ void handle_touch_cancel(struct libinput_event *event, struct libinput_event_touch *tevent = libinput_event_get_touch_event(event); struct wlr_event_touch_cancel wlr_event = { 0 }; + wlr_event.device = wlr_dev; wlr_event.time_sec = libinput_event_touch_get_time(tevent); wlr_event.time_usec = libinput_event_touch_get_time_usec(tevent); wlr_event.slot = libinput_event_touch_get_slot(tevent); diff --git a/include/wlr/types/wlr_touch.h b/include/wlr/types/wlr_touch.h index 93069fcb..1a27cad3 100644 --- a/include/wlr/types/wlr_touch.h +++ b/include/wlr/types/wlr_touch.h @@ -19,6 +19,7 @@ struct wlr_touch { }; struct wlr_event_touch_down { + struct wlr_input_device *device; uint32_t time_sec; uint64_t time_usec; int32_t slot; @@ -27,12 +28,14 @@ struct wlr_event_touch_down { }; struct wlr_event_touch_up { + struct wlr_input_device *device; uint32_t time_sec; uint64_t time_usec; int32_t slot; }; struct wlr_event_touch_motion { + struct wlr_input_device *device; uint32_t time_sec; uint64_t time_usec; int32_t slot; @@ -41,6 +44,7 @@ struct wlr_event_touch_motion { }; struct wlr_event_touch_cancel { + struct wlr_input_device *device; uint32_t time_sec; uint64_t time_usec; int32_t slot; -- cgit v1.2.3