aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-06-30 11:39:17 +0200
committerSimon Ser <contact@emersion.fr>2021-07-08 09:12:17 +0200
commit2d36d7fb6701c47b483759bd54c0f1526abc5e67 (patch)
tree93e587027cd7c0418acfef7631dce461beb68f0f
parent84906a832f77aaef8c055a83955db63ea4618a01 (diff)
backend/libinput: send touch frame events
-rw-r--r--backend/libinput/events.c2
-rw-r--r--backend/libinput/touch.c11
-rw-r--r--include/backend/libinput.h2
3 files changed, 14 insertions, 1 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index e5778bc9..1fc8cc09 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -271,7 +271,7 @@ void handle_libinput_event(struct wlr_libinput_backend *backend,
handle_touch_cancel(event, libinput_dev);
break;
case LIBINPUT_EVENT_TOUCH_FRAME:
- // no-op (at least for now)
+ handle_touch_frame(event, libinput_dev);
break;
case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
handle_tablet_tool_axis(event, libinput_dev);
diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c
index f69bba75..ee987a91 100644
--- a/backend/libinput/touch.c
+++ b/backend/libinput/touch.c
@@ -95,3 +95,14 @@ void handle_touch_cancel(struct libinput_event *event,
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
wlr_signal_emit_safe(&wlr_dev->touch->events.cancel, &wlr_event);
}
+
+void handle_touch_frame(struct libinput_event *event,
+ struct libinput_device *libinput_dev) {
+ struct wlr_input_device *wlr_dev =
+ get_appropriate_device(WLR_INPUT_DEVICE_TOUCH, libinput_dev);
+ if (!wlr_dev) {
+ wlr_log(WLR_DEBUG, "Got a touch event for a device with no touch?");
+ return;
+ }
+ wlr_signal_emit_safe(&wlr_dev->touch->events.frame, NULL);
+}
diff --git a/include/backend/libinput.h b/include/backend/libinput.h
index 2bfb1421..06e23a17 100644
--- a/include/backend/libinput.h
+++ b/include/backend/libinput.h
@@ -82,6 +82,8 @@ void handle_touch_motion(struct libinput_event *event,
struct libinput_device *device);
void handle_touch_cancel(struct libinput_event *event,
struct libinput_device *device);
+void handle_touch_frame(struct libinput_event *event,
+ struct libinput_device *device);
struct wlr_tablet *create_libinput_tablet(
struct libinput_device *device);