aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-02-12 09:12:31 +0100
committeremersion <contact@emersion.fr>2018-02-12 09:12:31 +0100
commit5e58d46cc1a90810e3ee76203cee8ca2f14fb462 (patch)
treea5019d87cdc121842ab7cf867fbcac0fde4ccff0 /backend/x11
parent3497e53516d96ad67b26115e2e06218f68e1114d (diff)
Add wlr_signal_emit_safe
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/backend.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 411d0ef6..2417810a 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -22,6 +22,7 @@
#include <wlr/interfaces/wlr_keyboard.h>
#include <wlr/interfaces/wlr_pointer.h>
#include <wlr/util/log.h>
+#include <wlr/util/signal.h>
#include "backend/x11.h"
static struct wlr_backend_impl backend_impl;
@@ -77,7 +78,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
.orientation = WLR_AXIS_ORIENTATION_VERTICAL,
.delta = delta,
};
- wl_signal_emit(&x11->pointer.events.axis, &axis);
+ wlr_signal_emit_safe(&x11->pointer.events.axis, &axis);
x11->time = ev->time;
break;
}
@@ -96,7 +97,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED,
};
- wl_signal_emit(&x11->pointer.events.button, &button);
+ wlr_signal_emit_safe(&x11->pointer.events.button, &button);
}
x11->time = ev->time;
break;
@@ -112,7 +113,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
.height_mm = output->wlr_output.height,
};
- wl_signal_emit(&x11->pointer.events.motion_absolute, &abs);
+ wlr_signal_emit_safe(&x11->pointer.events.motion_absolute, &abs);
x11->time = ev->time;
break;
}
@@ -140,7 +141,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
.height_mm = output->wlr_output.height,
};
- wl_signal_emit(&x11->pointer.events.motion_absolute, &abs);
+ wlr_signal_emit_safe(&x11->pointer.events.motion_absolute, &abs);
break;
}
case XCB_GLX_DELETE_QUERIES_ARB: {
@@ -229,9 +230,9 @@ static bool wlr_x11_backend_start(struct wlr_backend *backend) {
xcb_flush(x11->xcb_conn);
wlr_output_update_enabled(&output->wlr_output, true);
- wl_signal_emit(&x11->backend.events.output_add, output);
- wl_signal_emit(&x11->backend.events.input_add, &x11->keyboard_dev);
- wl_signal_emit(&x11->backend.events.input_add, &x11->pointer_dev);
+ wlr_signal_emit_safe(&x11->backend.events.output_add, output);
+ wlr_signal_emit_safe(&x11->backend.events.input_add, &x11->keyboard_dev);
+ wlr_signal_emit_safe(&x11->backend.events.input_add, &x11->pointer_dev);
wl_event_source_timer_update(x11->frame_timer, 16);
@@ -248,8 +249,8 @@ static void wlr_x11_backend_destroy(struct wlr_backend *backend) {
struct wlr_x11_output *output = &x11->output;
wlr_output_destroy(&output->wlr_output);
- wl_signal_emit(&backend->events.input_remove, &x11->pointer_dev);
- wl_signal_emit(&backend->events.input_remove, &x11->keyboard_dev);
+ wlr_signal_emit_safe(&backend->events.input_remove, &x11->pointer_dev);
+ wlr_signal_emit_safe(&backend->events.input_remove, &x11->keyboard_dev);
// TODO probably need to use wlr_keyboard_destroy, but the devices need to
// be malloced for that to work
if (x11->keyboard_dev.keyboard->keymap) {
@@ -259,7 +260,7 @@ static void wlr_x11_backend_destroy(struct wlr_backend *backend) {
xkb_state_unref(x11->keyboard_dev.keyboard->xkb_state);
}
- wl_signal_emit(&backend->events.destroy, backend);
+ wlr_signal_emit_safe(&backend->events.destroy, backend);
wl_list_remove(&x11->display_destroy.link);