diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-02-13 08:30:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-13 08:30:54 -0500 |
commit | 71cba94e73022d8cef8651055204a4706377ae11 (patch) | |
tree | 8ea1a2b6a0414fd7904824ffac330cd4e1e96ca2 /backend/libinput/pointer.c | |
parent | 3497e53516d96ad67b26115e2e06218f68e1114d (diff) | |
parent | c2e147401048aa53aebd52f1851b1da8c91043a3 (diff) |
Merge pull request #627 from emersion/wlr-signal-emit-safe
Remove wlr_backend.events.{output_remove,device_remove}
Diffstat (limited to 'backend/libinput/pointer.c')
-rw-r--r-- | backend/libinput/pointer.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index 13402ac2..8a31d312 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.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_pointer.h> +#include <wlr/types/wlr_input_device.h> #include <wlr/util/log.h> #include "backend/libinput.h" +#include "util/signal.h" struct wlr_pointer *wlr_libinput_pointer_create( struct libinput_device *libinput_dev) { @@ -35,7 +36,7 @@ void handle_pointer_motion(struct libinput_event *event, usec_to_msec(libinput_event_pointer_get_time_usec(pevent)); wlr_event.delta_x = libinput_event_pointer_get_dx(pevent); wlr_event.delta_y = libinput_event_pointer_get_dy(pevent); - wl_signal_emit(&wlr_dev->pointer->events.motion, &wlr_event); + wlr_signal_emit_safe(&wlr_dev->pointer->events.motion, &wlr_event); } void handle_pointer_motion_abs(struct libinput_event *event, @@ -55,7 +56,7 @@ void handle_pointer_motion_abs(struct libinput_event *event, wlr_event.x_mm = libinput_event_pointer_get_absolute_x(pevent); wlr_event.y_mm = libinput_event_pointer_get_absolute_y(pevent); libinput_device_get_size(libinput_dev, &wlr_event.width_mm, &wlr_event.height_mm); - wl_signal_emit(&wlr_dev->pointer->events.motion_absolute, &wlr_event); + wlr_signal_emit_safe(&wlr_dev->pointer->events.motion_absolute, &wlr_event); } void handle_pointer_button(struct libinput_event *event, @@ -81,7 +82,7 @@ void handle_pointer_button(struct libinput_event *event, wlr_event.state = WLR_BUTTON_RELEASED; break; } - wl_signal_emit(&wlr_dev->pointer->events.button, &wlr_event); + wlr_signal_emit_safe(&wlr_dev->pointer->events.button, &wlr_event); } void handle_pointer_axis(struct libinput_event *event, @@ -128,7 +129,7 @@ void handle_pointer_axis(struct libinput_event *event, } wlr_event.delta = libinput_event_pointer_get_axis_value( pevent, axies[i]); - wl_signal_emit(&wlr_dev->pointer->events.axis, &wlr_event); + wlr_signal_emit_safe(&wlr_dev->pointer->events.axis, &wlr_event); } } } |