aboutsummaryrefslogtreecommitdiff
path: root/backend/headless/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/headless/backend.c')
-rw-r--r--backend/headless/backend.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c
index c56753ba..71c87dd0 100644
--- a/backend/headless/backend.c
+++ b/backend/headless/backend.c
@@ -3,6 +3,7 @@
#include <EGL/eglext.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"
@@ -11,11 +12,19 @@ static bool backend_start(struct wlr_backend *wlr_backend) {
(struct wlr_headless_backend *)wlr_backend;
wlr_log(L_INFO, "Starting headless backend");
- struct wlr_headless_backend_output *output;
+ struct wlr_headless_output *output;
wl_list_for_each(output, &backend->outputs, link) {
wl_event_source_timer_update(output->frame_timer, output->frame_delay);
wlr_output_create_global(&output->wlr_output, backend->display);
- wl_signal_emit(&backend->backend.events.output_add, &output->wlr_output);
+ wl_signal_emit(&backend->backend.events.output_add,
+ &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,
+ &input_device->wlr_input_device);
}
backend->started = true;
@@ -31,11 +40,17 @@ static void backend_destroy(struct wlr_backend *wlr_backend) {
wl_list_remove(&backend->display_destroy.link);
- struct wlr_headless_backend_output *output, *tmp;
- wl_list_for_each_safe(output, tmp, &backend->outputs, link) {
+ struct wlr_headless_output *output, *output_tmp;
+ wl_list_for_each_safe(output, output_tmp, &backend->outputs, link) {
wlr_output_destroy(&output->wlr_output);
}
+ struct wlr_headless_input_device *input_device, *input_device_tmp;
+ wl_list_for_each_safe(input_device, input_device_tmp,
+ &backend->input_devices, wlr_input_device.link) {
+ wlr_input_device_destroy(&input_device->wlr_input_device);
+ }
+
wlr_egl_finish(&backend->egl);
free(backend);
}
@@ -162,6 +177,7 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
wlr_backend_init(&backend->backend, &backend_impl);
backend->display = display;
wl_list_init(&backend->outputs);
+ wl_list_init(&backend->input_devices);
egl_init(&backend->egl);