aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
Diffstat (limited to 'backend/headless')
-rw-r--r--backend/headless/backend.c11
-rw-r--r--backend/headless/input_device.c10
-rw-r--r--backend/headless/output.c5
3 files changed, 14 insertions, 12 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c
index 0bf5ec28..663bc13b 100644
--- a/backend/headless/backend.c
+++ b/backend/headless/backend.c
@@ -1,9 +1,10 @@
+#include "util/signal.h"
#include <stdlib.h>
+#include <wlr/interfaces/wlr_input_device.h>
+#include <wlr/interfaces/wlr_output.h>
#include <wlr/render/egl.h>
#include <wlr/render/gles2.h>
#include <wlr/util/log.h>
-#include <wlr/interfaces/wlr_output.h>
-#include <wlr/interfaces/wlr_input_device.h>
#include "backend/headless.h"
#include "glapi.h"
@@ -16,14 +17,14 @@ static bool backend_start(struct wlr_backend *wlr_backend) {
wl_list_for_each(output, &backend->outputs, link) {
wl_event_source_timer_update(output->frame_timer, output->frame_delay);
wlr_output_update_enabled(&output->wlr_output, true);
- wl_signal_emit(&backend->backend.events.output_add,
+ wlr_signal_emit_safe(&backend->backend.events.new_output,
&output->wlr_output);
}
struct wlr_headless_input_device *input_device;
wl_list_for_each(input_device, &backend->input_devices,
wlr_input_device.link) {
- wl_signal_emit(&backend->backend.events.input_add,
+ wlr_signal_emit_safe(&backend->backend.events.new_input,
&input_device->wlr_input_device);
}
@@ -51,7 +52,7 @@ static void backend_destroy(struct wlr_backend *wlr_backend) {
wlr_input_device_destroy(&input_device->wlr_input_device);
}
- wl_signal_emit(&wlr_backend->events.destroy, backend);
+ wlr_signal_emit_safe(&wlr_backend->events.destroy, backend);
wlr_egl_finish(&backend->egl);
free(backend);
diff --git a/backend/headless/input_device.c b/backend/headless/input_device.c
index 5c62e87f..ea335aff 100644
--- a/backend/headless/input_device.c
+++ b/backend/headless/input_device.c
@@ -1,17 +1,17 @@
#include <stdlib.h>
#include <wlr/interfaces/wlr_input_device.h>
-#include <wlr/interfaces/wlr_pointer.h>
#include <wlr/interfaces/wlr_keyboard.h>
-#include <wlr/interfaces/wlr_touch.h>
-#include <wlr/interfaces/wlr_tablet_tool.h>
+#include <wlr/interfaces/wlr_pointer.h>
#include <wlr/interfaces/wlr_tablet_pad.h>
+#include <wlr/interfaces/wlr_tablet_tool.h>
+#include <wlr/interfaces/wlr_touch.h>
#include <wlr/util/log.h>
#include "backend/headless.h"
+#include "util/signal.h"
static void input_device_destroy(struct wlr_input_device *wlr_dev) {
struct wlr_headless_input_device *device =
(struct wlr_headless_input_device *)wlr_dev;
- wl_signal_emit(&device->backend->backend.events.input_remove, wlr_dev);
free(device);
}
@@ -88,7 +88,7 @@ struct wlr_input_device *wlr_headless_add_input_device(
wl_list_insert(&backend->input_devices, &wlr_device->link);
if (backend->started) {
- wl_signal_emit(&backend->backend.events.input_add, wlr_device);
+ wlr_signal_emit_safe(&backend->backend.events.new_input, wlr_device);
}
return wlr_device;
diff --git a/backend/headless/output.c b/backend/headless/output.c
index 507595a5..ba4a094e 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -1,10 +1,11 @@
-#include <stdlib.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
+#include <stdlib.h>
#include <wlr/interfaces/wlr_output.h>
#include <wlr/util/log.h>
#include "backend/headless.h"
+#include "util/signal.h"
static EGLSurface egl_create_surface(struct wlr_egl *egl, unsigned int width,
unsigned int height) {
@@ -136,7 +137,7 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
if (backend->started) {
wl_event_source_timer_update(output->frame_timer, output->frame_delay);
wlr_output_update_enabled(wlr_output, true);
- wl_signal_emit(&backend->backend.events.output_add, wlr_output);
+ wlr_signal_emit_safe(&backend->backend.events.new_output, wlr_output);
}
return wlr_output;