aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/touch.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-13 08:30:54 -0500
committerGitHub <noreply@github.com>2018-02-13 08:30:54 -0500
commit71cba94e73022d8cef8651055204a4706377ae11 (patch)
tree8ea1a2b6a0414fd7904824ffac330cd4e1e96ca2 /backend/libinput/touch.c
parent3497e53516d96ad67b26115e2e06218f68e1114d (diff)
parentc2e147401048aa53aebd52f1851b1da8c91043a3 (diff)
Merge pull request #627 from emersion/wlr-signal-emit-safe
Remove wlr_backend.events.{output_remove,device_remove}
Diffstat (limited to 'backend/libinput/touch.c')
-rw-r--r--backend/libinput/touch.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c
index 0ba6ec86..2b87f9cd 100644
--- a/backend/libinput/touch.c
+++ b/backend/libinput/touch.c
@@ -1,11 +1,12 @@
-#include <stdlib.h>
#include <assert.h>
#include <libinput.h>
+#include <stdlib.h>
#include <wlr/backend/session.h>
-#include <wlr/types/wlr_input_device.h>
#include <wlr/interfaces/wlr_touch.h>
+#include <wlr/types/wlr_input_device.h>
#include <wlr/util/log.h>
#include "backend/libinput.h"
+#include "util/signal.h"
struct wlr_touch *wlr_libinput_touch_create(
struct libinput_device *libinput_dev) {
@@ -37,7 +38,7 @@ void handle_touch_down(struct libinput_event *event,
wlr_event.x_mm = libinput_event_touch_get_x(tevent);
wlr_event.y_mm = libinput_event_touch_get_y(tevent);
libinput_device_get_size(libinput_dev, &wlr_event.width_mm, &wlr_event.height_mm);
- wl_signal_emit(&wlr_dev->touch->events.down, &wlr_event);
+ wlr_signal_emit_safe(&wlr_dev->touch->events.down, &wlr_event);
}
void handle_touch_up(struct libinput_event *event,
@@ -55,7 +56,7 @@ void handle_touch_up(struct libinput_event *event,
wlr_event.time_msec =
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
wlr_event.touch_id = libinput_event_touch_get_slot(tevent);
- wl_signal_emit(&wlr_dev->touch->events.up, &wlr_event);
+ wlr_signal_emit_safe(&wlr_dev->touch->events.up, &wlr_event);
}
void handle_touch_motion(struct libinput_event *event,
@@ -76,7 +77,7 @@ void handle_touch_motion(struct libinput_event *event,
wlr_event.x_mm = libinput_event_touch_get_x(tevent);
wlr_event.y_mm = libinput_event_touch_get_y(tevent);
libinput_device_get_size(libinput_dev, &wlr_event.width_mm, &wlr_event.height_mm);
- wl_signal_emit(&wlr_dev->touch->events.motion, &wlr_event);
+ wlr_signal_emit_safe(&wlr_dev->touch->events.motion, &wlr_event);
}
void handle_touch_cancel(struct libinput_event *event,
@@ -94,5 +95,5 @@ void handle_touch_cancel(struct libinput_event *event,
wlr_event.time_msec =
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
wlr_event.touch_id = libinput_event_touch_get_slot(tevent);
- wl_signal_emit(&wlr_dev->touch->events.cancel, &wlr_event);
+ wlr_signal_emit_safe(&wlr_dev->touch->events.cancel, &wlr_event);
}