Add wlr_signal_emit_safe

This commit is contained in:
emersion 2018-02-12 09:12:31 +01:00
parent 3497e53516
commit 5e58d46cc1
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
43 changed files with 265 additions and 182 deletions

View file

@ -5,6 +5,7 @@
#include <wlr/types/wlr_input_device.h>
#include <wlr/interfaces/wlr_touch.h>
#include <wlr/util/log.h>
#include <wlr/util/signal.h>
#include "backend/libinput.h"
struct wlr_touch *wlr_libinput_touch_create(
@ -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);
}