aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/events.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/events.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/events.c')
-rw-r--r--backend/libinput/events.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index 758a9f25..603eed07 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -1,11 +1,12 @@
-#include <stdlib.h>
#include <assert.h>
#include <libinput.h>
+#include <stdlib.h>
+#include <wayland-util.h>
#include <wlr/backend/session.h>
#include <wlr/interfaces/wlr_input_device.h>
#include <wlr/util/log.h>
-#include <wayland-util.h>
#include "backend/libinput.h"
+#include "util/signal.h"
struct wlr_input_device *get_appropriate_device(
enum wlr_input_device_type desired_type,
@@ -88,7 +89,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
free(wlr_dev);
goto fail;
}
- wl_signal_emit(&backend->backend.events.input_add, wlr_dev);
+ wlr_signal_emit_safe(&backend->backend.events.new_input, wlr_dev);
}
if (libinput_device_has_capability(libinput_dev, LIBINPUT_DEVICE_CAP_POINTER)) {
struct wlr_input_device *wlr_dev = allocate_device(backend,
@@ -101,7 +102,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
free(wlr_dev);
goto fail;
}
- wl_signal_emit(&backend->backend.events.input_add, wlr_dev);
+ wlr_signal_emit_safe(&backend->backend.events.new_input, wlr_dev);
}
if (libinput_device_has_capability(libinput_dev, LIBINPUT_DEVICE_CAP_TOUCH)) {
struct wlr_input_device *wlr_dev = allocate_device(backend,
@@ -114,7 +115,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
free(wlr_dev);
goto fail;
}
- wl_signal_emit(&backend->backend.events.input_add, wlr_dev);
+ wlr_signal_emit_safe(&backend->backend.events.new_input, wlr_dev);
}
if (libinput_device_has_capability(libinput_dev, LIBINPUT_DEVICE_CAP_TABLET_TOOL)) {
struct wlr_input_device *wlr_dev = allocate_device(backend,
@@ -127,7 +128,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
free(wlr_dev);
goto fail;
}
- wl_signal_emit(&backend->backend.events.input_add, wlr_dev);
+ wlr_signal_emit_safe(&backend->backend.events.new_input, wlr_dev);
}
if (libinput_device_has_capability(libinput_dev, LIBINPUT_DEVICE_CAP_TABLET_PAD)) {
struct wlr_input_device *wlr_dev = allocate_device(backend,
@@ -140,7 +141,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
free(wlr_dev);
goto fail;
}
- wl_signal_emit(&backend->backend.events.input_add, wlr_dev);
+ wlr_signal_emit_safe(&backend->backend.events.new_input, wlr_dev);
}
if (libinput_device_has_capability(libinput_dev, LIBINPUT_DEVICE_CAP_GESTURE)) {
// TODO
@@ -178,7 +179,6 @@ static void handle_device_removed(struct wlr_libinput_backend *backend,
}
struct wlr_input_device *dev, *tmp_dev;
wl_list_for_each_safe(dev, tmp_dev, wlr_devices, link) {
- wl_signal_emit(&backend->backend.events.input_remove, dev);
wlr_input_device_destroy(dev);
}
for (size_t i = 0; i < backend->wlr_device_lists.length; i++) {