mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
Add wlr_signal_emit_safe
This commit is contained in:
parent
3497e53516
commit
5e58d46cc1
43 changed files with 265 additions and 182 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <wlr/render/egl.h>
|
||||
#include <wlr/render/gles2.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <wlr/util/signal.h>
|
||||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include "backend/headless.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.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,
|
||||
wlr_signal_emit_safe(&backend->backend.events.input_add,
|
||||
&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);
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
#include <wlr/interfaces/wlr_tablet_tool.h>
|
||||
#include <wlr/interfaces/wlr_tablet_pad.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <wlr/util/signal.h>
|
||||
#include "backend/headless.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);
|
||||
wlr_signal_emit_safe(&device->backend->backend.events.input_remove, wlr_dev);
|
||||
free(device);
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +89,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.input_add, wlr_device);
|
||||
}
|
||||
|
||||
return wlr_device;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <GLES2/gl2.h>
|
||||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <wlr/util/signal.h>
|
||||
#include "backend/headless.h"
|
||||
|
||||
static EGLSurface egl_create_surface(struct wlr_egl *egl, unsigned int width,
|
||||
|
|
@ -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.output_add, wlr_output);
|
||||
}
|
||||
|
||||
return wlr_output;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue