Use wl_signal_emit_mutable

This commit is contained in:
Alexander Orzechowski 2022-08-18 07:16:16 -04:00
parent 013f121f45
commit ef4baea0e2
91 changed files with 365 additions and 456 deletions

View file

@ -9,7 +9,6 @@
#include <wlr/types/wlr_seat.h>
#include <wlr/util/log.h>
#include "types/wlr_data_device.h"
#include "util/signal.h"
#define DATA_DEVICE_MANAGER_VERSION 3
@ -162,7 +161,7 @@ void wlr_seat_request_set_selection(struct wlr_seat *seat,
.source = source,
.serial = serial,
};
wlr_signal_emit_safe(&seat->events.request_set_selection, &event);
wl_signal_emit_mutable(&seat->events.request_set_selection, &event);
}
static void seat_handle_selection_source_destroy(
@ -179,7 +178,7 @@ static void seat_handle_selection_source_destroy(
seat_client_send_selection(focused_client);
}
wlr_signal_emit_safe(&seat->events.set_selection, seat);
wl_signal_emit_mutable(&seat->events.set_selection, seat);
}
void wlr_seat_set_selection(struct wlr_seat *seat,
@ -211,7 +210,7 @@ void wlr_seat_set_selection(struct wlr_seat *seat,
seat_client_send_selection(focused_client);
}
wlr_signal_emit_safe(&seat->events.set_selection, seat);
wl_signal_emit_mutable(&seat->events.set_selection, seat);
}
@ -280,7 +279,7 @@ static void data_device_manager_bind(struct wl_client *client,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_data_device_manager *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -8,7 +8,6 @@
#include <wlr/types/wlr_seat.h>
#include <wlr/util/log.h>
#include "types/wlr_data_device.h"
#include "util/signal.h"
static const struct wl_data_offer_interface data_offer_impl;

View file

@ -9,7 +9,6 @@
#include <wlr/types/wlr_seat.h>
#include <wlr/util/log.h>
#include "types/wlr_data_device.h"
#include "util/signal.h"
void wlr_data_source_init(struct wlr_data_source *source,
const struct wlr_data_source_impl *impl) {
@ -40,7 +39,7 @@ void wlr_data_source_destroy(struct wlr_data_source *source) {
return;
}
wlr_signal_emit_safe(&source->events.destroy, source);
wl_signal_emit_mutable(&source->events.destroy, source);
char **p;
wl_array_for_each(p, &source->mime_types) {

View file

@ -9,7 +9,6 @@
#include <wlr/types/wlr_seat.h>
#include <wlr/util/log.h>
#include "types/wlr_data_device.h"
#include "util/signal.h"
static void drag_handle_seat_client_destroy(struct wl_listener *listener,
void *data) {
@ -104,16 +103,16 @@ static void drag_set_focus(struct wlr_drag *drag,
wl_signal_add(&focus_client->events.destroy, &drag->seat_client_destroy);
out:
wlr_signal_emit_safe(&drag->events.focus, drag);
wl_signal_emit_mutable(&drag->events.focus, drag);
}
static void drag_icon_set_mapped(struct wlr_drag_icon *icon, bool mapped) {
if (mapped && !icon->mapped) {
icon->mapped = true;
wlr_signal_emit_safe(&icon->events.map, icon);
wl_signal_emit_mutable(&icon->events.map, icon);
} else if (!mapped && icon->mapped) {
icon->mapped = false;
wlr_signal_emit_safe(&icon->events.unmap, icon);
wl_signal_emit_mutable(&icon->events.unmap, icon);
}
}
@ -151,7 +150,7 @@ static void drag_destroy(struct wlr_drag *drag) {
// to ensure that the wl_data_device.leave is sent before emitting the
// signal. This allows e.g. wl_pointer.enter to be sent in the destroy
// signal handler.
wlr_signal_emit_safe(&drag->events.destroy, drag);
wl_signal_emit_mutable(&drag->events.destroy, drag);
if (drag->source) {
wl_list_remove(&drag->source_destroy.link);
@ -188,7 +187,7 @@ static void drag_handle_pointer_motion(struct wlr_seat_pointer_grab *grab,
.sx = sx,
.sy = sy,
};
wlr_signal_emit_safe(&drag->events.motion, &event);
wl_signal_emit_mutable(&drag->events.motion, &event);
}
}
@ -209,7 +208,7 @@ static void drag_drop(struct wlr_drag *drag, uint32_t time) {
.drag = drag,
.time = time,
};
wlr_signal_emit_safe(&drag->events.drop, &event);
wl_signal_emit_mutable(&drag->events.drop, &event);
}
static uint32_t drag_handle_pointer_button(struct wlr_seat_pointer_grab *grab,
@ -364,7 +363,7 @@ static void drag_icon_destroy(struct wlr_drag_icon *icon) {
return;
}
drag_icon_set_mapped(icon, false);
wlr_signal_emit_safe(&icon->events.destroy, icon);
wl_signal_emit_mutable(&icon->events.destroy, icon);
icon->surface->role_data = NULL;
wl_list_remove(&icon->surface_destroy.link);
free(icon);
@ -480,7 +479,7 @@ void wlr_seat_request_start_drag(struct wlr_seat *seat, struct wlr_drag *drag,
.origin = origin,
.serial = serial,
};
wlr_signal_emit_safe(&seat->events.request_start_drag, &event);
wl_signal_emit_mutable(&seat->events.request_start_drag, &event);
}
static void seat_handle_drag_source_destroy(struct wl_listener *listener,
@ -511,7 +510,7 @@ void wlr_seat_start_drag(struct wlr_seat *seat, struct wlr_drag *drag,
wl_signal_add(&drag->source->events.destroy, &seat->drag_source_destroy);
}
wlr_signal_emit_safe(&seat->events.start_drag, drag);
wl_signal_emit_mutable(&seat->events.start_drag, drag);
}
void wlr_seat_start_pointer_drag(struct wlr_seat *seat, struct wlr_drag *drag,

View file

@ -10,7 +10,6 @@
#include "render/swapchain.h"
#include "types/wlr_buffer.h"
#include "types/wlr_output.h"
#include "util/signal.h"
static bool output_set_hardware_cursor(struct wlr_output *output,
struct wlr_buffer *buffer, int hotspot_x, int hotspot_y) {
@ -168,7 +167,7 @@ static void output_cursor_damage_whole(struct wlr_output_cursor *cursor) {
.output = cursor->output,
.damage = &damage,
};
wlr_signal_emit_safe(&cursor->output->events.damage, &event);
wl_signal_emit_mutable(&cursor->output->events.damage, &event);
pixman_region32_fini(&damage);
}

View file

@ -11,7 +11,6 @@
#include "render/swapchain.h"
#include "types/wlr_output.h"
#include "util/global.h"
#include "util/signal.h"
#define OUTPUT_VERSION 4
@ -124,7 +123,7 @@ static void output_bind(struct wl_client *wl_client, void *data,
.resource = resource,
};
wlr_signal_emit_safe(&output->events.bind, &evt);
wl_signal_emit_mutable(&output->events.bind, &evt);
}
void wlr_output_create_global(struct wlr_output *output) {
@ -187,7 +186,7 @@ void wlr_output_update_enabled(struct wlr_output *output, bool enabled) {
}
output->enabled = enabled;
wlr_signal_emit_safe(&output->events.enable, output);
wl_signal_emit_mutable(&output->events.enable, output);
}
static void output_update_matrix(struct wlr_output *output) {
@ -255,7 +254,7 @@ void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width,
}
wlr_output_schedule_done(output);
wlr_signal_emit_safe(&output->events.mode, output);
wl_signal_emit_mutable(&output->events.mode, output);
}
void wlr_output_set_transform(struct wlr_output *output,
@ -306,7 +305,7 @@ void wlr_output_set_description(struct wlr_output *output, const char *desc) {
}
wlr_output_schedule_done(output);
wlr_signal_emit_safe(&output->events.description, output);
wl_signal_emit_mutable(&output->events.description, output);
}
static void handle_display_destroy(struct wl_listener *listener, void *data) {
@ -389,7 +388,7 @@ void wlr_output_destroy(struct wlr_output *output) {
wlr_output_destroy_global(output);
output_clear_back_buffer(output);
wlr_signal_emit_safe(&output->events.destroy, output);
wl_signal_emit_mutable(&output->events.destroy, output);
wlr_addon_set_finish(&output->addons);
// The backend is responsible for free-ing the list of modes
@ -747,7 +746,7 @@ bool wlr_output_commit_state(struct wlr_output *output,
.when = &now,
.state = &pending,
};
wlr_signal_emit_safe(&output->events.precommit, &pre_event);
wl_signal_emit_mutable(&output->events.precommit, &pre_event);
// output_clear_back_buffer detaches the buffer from the renderer. This is
// important to do before calling impl->commit(), because this marks an
@ -837,7 +836,7 @@ bool wlr_output_commit_state(struct wlr_output *output,
.when = &now,
.buffer = (pending.committed & WLR_OUTPUT_STATE_BUFFER) ? pending.buffer : NULL,
};
wlr_signal_emit_safe(&output->events.commit, &event);
wl_signal_emit_mutable(&output->events.commit, &event);
wlr_buffer_unlock(back_buffer);
if (new_back_buffer) {
@ -876,7 +875,7 @@ void wlr_output_attach_buffer(struct wlr_output *output,
void wlr_output_send_frame(struct wlr_output *output) {
output->frame_pending = false;
if (output->enabled) {
wlr_signal_emit_safe(&output->events.frame, output);
wl_signal_emit_mutable(&output->events.frame, output);
}
}
@ -922,7 +921,7 @@ void wlr_output_send_present(struct wlr_output *output,
event->when = &now;
}
wlr_signal_emit_safe(&output->events.present, event);
wl_signal_emit_mutable(&output->events.present, event);
}
void wlr_output_set_gamma(struct wlr_output *output, size_t size,
@ -954,7 +953,7 @@ void wlr_output_update_needs_frame(struct wlr_output *output) {
return;
}
output->needs_frame = true;
wlr_signal_emit_safe(&output->events.needs_frame, output);
wl_signal_emit_mutable(&output->events.needs_frame, output);
}
void wlr_output_damage_whole(struct wlr_output *output) {
@ -968,7 +967,7 @@ void wlr_output_damage_whole(struct wlr_output *output) {
.output = output,
.damage = &damage,
};
wlr_signal_emit_safe(&output->events.damage, &event);
wl_signal_emit_mutable(&output->events.damage, &event);
pixman_region32_fini(&damage);
}

View file

@ -13,7 +13,6 @@
#include <wlr/util/region.h>
#include "types/wlr_buffer.h"
#include "types/wlr_scene.h"
#include "util/signal.h"
#include "util/time.h"
#define HIGHLIGHT_DAMAGE_FADEOUT_TIME 250
@ -83,7 +82,7 @@ void wlr_scene_node_destroy(struct wlr_scene_node *node) {
// We want to call the destroy listeners before we do anything else
// in case the destroy signal would like to remove children before they
// are recursively destroyed.
wlr_signal_emit_safe(&node->events.destroy, NULL);
wl_signal_emit_mutable(&node->events.destroy, NULL);
wlr_scene_node_set_enabled(node, false);
@ -96,7 +95,7 @@ void wlr_scene_node_destroy(struct wlr_scene_node *node) {
struct wlr_scene_output *scene_output;
wl_list_for_each(scene_output, &scene->outputs, link) {
if (active & (1ull << scene_output->index)) {
wlr_signal_emit_safe(&scene_buffer->events.output_leave,
wl_signal_emit_mutable(&scene_buffer->events.output_leave,
scene_output);
}
}
@ -385,9 +384,9 @@ static void update_node_update_outputs(struct wlr_scene_node *node,
bool intersects_before = old_active & mask;
if (intersects && !intersects_before) {
wlr_signal_emit_safe(&scene_buffer->events.output_enter, scene_output);
wl_signal_emit_mutable(&scene_buffer->events.output_enter, scene_output);
} else if (!intersects && intersects_before) {
wlr_signal_emit_safe(&scene_buffer->events.output_leave, scene_output);
wl_signal_emit_mutable(&scene_buffer->events.output_leave, scene_output);
}
}
}
@ -723,7 +722,7 @@ void wlr_scene_buffer_set_transform(struct wlr_scene_buffer *scene_buffer,
void wlr_scene_buffer_send_frame_done(struct wlr_scene_buffer *scene_buffer,
struct timespec *now) {
if (pixman_region32_not_empty(&scene_buffer->node.visible)) {
wlr_signal_emit_safe(&scene_buffer->events.frame_done, now);
wl_signal_emit_mutable(&scene_buffer->events.frame_done, now);
}
}
@ -1106,7 +1105,7 @@ static void scene_node_render(struct wlr_scene_node *node,
render_texture(output, &render_region, texture, &scene_buffer->src_box,
&dst_box, matrix);
wlr_signal_emit_safe(&scene_buffer->events.output_present, scene_output);
wl_signal_emit_mutable(&scene_buffer->events.output_present, scene_output);
break;
}
@ -1259,7 +1258,7 @@ void wlr_scene_output_destroy(struct wlr_scene_output *scene_output) {
return;
}
wlr_signal_emit_safe(&scene_output->events.destroy, NULL);
wl_signal_emit_mutable(&scene_output->events.destroy, NULL);
scene_node_output_update(&scene_output->scene->tree.node,
&scene_output->scene->outputs, scene_output);
@ -1498,7 +1497,7 @@ bool wlr_scene_output_commit(struct wlr_scene_output *scene_output) {
assert(node->type == WLR_SCENE_NODE_BUFFER);
struct wlr_scene_buffer *buffer = wlr_scene_buffer_from_node(node);
wlr_signal_emit_safe(&buffer->events.output_present, scene_output);
wl_signal_emit_mutable(&buffer->events.output_present, scene_output);
return true;
}

View file

@ -11,7 +11,6 @@
#include <wlr/util/log.h>
#include "types/wlr_seat.h"
#include "util/global.h"
#include "util/signal.h"
#define SEAT_VERSION 8
@ -67,7 +66,7 @@ static void seat_client_handle_resource_destroy(
return;
}
wlr_signal_emit_safe(&client->events.destroy, client);
wl_signal_emit_mutable(&client->events.destroy, client);
if (client == client->seat->pointer_state.focused_client) {
client->seat->pointer_state.focused_client = NULL;
@ -181,7 +180,7 @@ void wlr_seat_destroy(struct wlr_seat *seat) {
wlr_seat_touch_point_clear_focus(seat, 0, point->touch_id);
}
wlr_signal_emit_safe(&seat->events.destroy, seat);
wl_signal_emit_mutable(&seat->events.destroy, seat);
wl_list_remove(&seat->display_destroy.link);

View file

@ -8,7 +8,6 @@
#include <wlr/util/log.h>
#include "types/wlr_data_device.h"
#include "types/wlr_seat.h"
#include "util/signal.h"
static void default_keyboard_enter(struct wlr_seat_keyboard_grab *grab,
struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
@ -168,7 +167,7 @@ void wlr_seat_keyboard_start_grab(struct wlr_seat *wlr_seat,
grab->seat = wlr_seat;
wlr_seat->keyboard_state.grab = grab;
wlr_signal_emit_safe(&wlr_seat->events.keyboard_grab_begin, grab);
wl_signal_emit_mutable(&wlr_seat->events.keyboard_grab_begin, grab);
}
void wlr_seat_keyboard_end_grab(struct wlr_seat *wlr_seat) {
@ -176,7 +175,7 @@ void wlr_seat_keyboard_end_grab(struct wlr_seat *wlr_seat) {
if (grab != wlr_seat->keyboard_state.default_grab) {
wlr_seat->keyboard_state.grab = wlr_seat->keyboard_state.default_grab;
wlr_signal_emit_safe(&wlr_seat->events.keyboard_grab_end, grab);
wl_signal_emit_mutable(&wlr_seat->events.keyboard_grab_end, grab);
if (grab->interface->cancel) {
grab->interface->cancel(grab);
}
@ -303,7 +302,7 @@ void wlr_seat_keyboard_enter(struct wlr_seat *seat,
.old_surface = focused_surface,
.new_surface = surface,
};
wlr_signal_emit_safe(&seat->keyboard_state.events.focus_change, &event);
wl_signal_emit_mutable(&seat->keyboard_state.events.focus_change, &event);
}
void wlr_seat_keyboard_notify_enter(struct wlr_seat *seat,

View file

@ -7,7 +7,6 @@
#include <wlr/types/wlr_compositor.h>
#include <wlr/util/log.h>
#include "types/wlr_seat.h"
#include "util/signal.h"
#include "util/array.h"
static void default_pointer_enter(struct wlr_seat_pointer_grab *grab,
@ -101,7 +100,7 @@ static void pointer_set_cursor(struct wl_client *client,
.hotspot_x = hotspot_x,
.hotspot_y = hotspot_y,
};
wlr_signal_emit_safe(&seat_client->seat->events.request_set_cursor, &event);
wl_signal_emit_mutable(&seat_client->seat->events.request_set_cursor, &event);
}
static void pointer_release(struct wl_client *client,
@ -211,7 +210,7 @@ void wlr_seat_pointer_enter(struct wlr_seat *wlr_seat,
.sx = sx,
.sy = sy,
};
wlr_signal_emit_safe(&wlr_seat->pointer_state.events.focus_change, &event);
wl_signal_emit_mutable(&wlr_seat->pointer_state.events.focus_change, &event);
}
void wlr_seat_pointer_clear_focus(struct wlr_seat *wlr_seat) {
@ -403,14 +402,14 @@ void wlr_seat_pointer_start_grab(struct wlr_seat *wlr_seat,
grab->seat = wlr_seat;
wlr_seat->pointer_state.grab = grab;
wlr_signal_emit_safe(&wlr_seat->events.pointer_grab_begin, grab);
wl_signal_emit_mutable(&wlr_seat->events.pointer_grab_begin, grab);
}
void wlr_seat_pointer_end_grab(struct wlr_seat *wlr_seat) {
struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab;
if (grab != wlr_seat->pointer_state.default_grab) {
wlr_seat->pointer_state.grab = wlr_seat->pointer_state.default_grab;
wlr_signal_emit_safe(&wlr_seat->events.pointer_grab_end, grab);
wl_signal_emit_mutable(&wlr_seat->events.pointer_grab_end, grab);
if (grab->interface->cancel) {
grab->interface->cancel(grab);
}

View file

@ -7,7 +7,6 @@
#include <wlr/types/wlr_compositor.h>
#include <wlr/util/log.h>
#include "types/wlr_seat.h"
#include "util/signal.h"
static uint32_t default_touch_down(struct wlr_seat_touch_grab *grab,
uint32_t time, struct wlr_touch_point *point) {
@ -84,7 +83,7 @@ void wlr_seat_touch_start_grab(struct wlr_seat *wlr_seat,
grab->seat = wlr_seat;
wlr_seat->touch_state.grab = grab;
wlr_signal_emit_safe(&wlr_seat->events.touch_grab_begin, grab);
wl_signal_emit_mutable(&wlr_seat->events.touch_grab_begin, grab);
}
void wlr_seat_touch_end_grab(struct wlr_seat *wlr_seat) {
@ -92,7 +91,7 @@ void wlr_seat_touch_end_grab(struct wlr_seat *wlr_seat) {
if (grab != wlr_seat->touch_state.default_grab) {
wlr_seat->touch_state.grab = wlr_seat->touch_state.default_grab;
wlr_signal_emit_safe(&wlr_seat->events.touch_grab_end, grab);
wl_signal_emit_mutable(&wlr_seat->events.touch_grab_end, grab);
if (grab->interface->cancel) {
grab->interface->cancel(grab);
}
@ -108,7 +107,7 @@ static void touch_point_clear_focus(struct wlr_touch_point *point) {
}
static void touch_point_destroy(struct wlr_touch_point *point) {
wlr_signal_emit_safe(&point->events.destroy, point);
wl_signal_emit_mutable(&point->events.destroy, point);
touch_point_clear_focus(point);
wl_list_remove(&point->surface_destroy.link);

View file

@ -13,7 +13,6 @@
#include <wlr/types/wlr_tablet_v2.h>
#include <wlr/util/log.h>
#include "tablet-unstable-v2-protocol.h"
#include "util/signal.h"
#define TABLET_MANAGER_VERSION 1
@ -275,7 +274,7 @@ static void tablet_v2_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_tablet_manager_v2 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->wl_global);
free(manager);

View file

@ -11,7 +11,6 @@
#include <wlr/types/wlr_tablet_pad.h>
#include <wlr/types/wlr_tablet_v2.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "tablet-unstable-v2-protocol.h"
static const struct wlr_tablet_pad_v2_grab_interface default_pad_grab_interface;
@ -52,7 +51,7 @@ static void handle_tablet_pad_ring_v2_set_feedback(struct wl_client *client,
.index = aux->index
};
wlr_signal_emit_safe(&aux->pad->pad->events.ring_feedback, &evt);
wl_signal_emit_mutable(&aux->pad->pad->events.ring_feedback, &evt);
}
static void handle_tablet_pad_ring_v2_destroy(struct wl_client *client,
@ -90,7 +89,7 @@ static void handle_tablet_pad_strip_v2_set_feedback(struct wl_client *client,
.index = aux->index
};
wlr_signal_emit_safe(&aux->pad->pad->events.strip_feedback, &evt);
wl_signal_emit_mutable(&aux->pad->pad->events.strip_feedback, &evt);
}
static void handle_tablet_pad_strip_v2_destroy(struct wl_client *client,
@ -117,7 +116,7 @@ static void handle_tablet_pad_v2_set_feedback( struct wl_client *client,
.description = description,
};
wlr_signal_emit_safe(&pad->pad->events.button_feedback, &evt);
wl_signal_emit_mutable(&pad->pad->events.button_feedback, &evt);
}
static const struct zwp_tablet_pad_v2_interface tablet_pad_impl = {

View file

@ -11,7 +11,6 @@
#include <wlr/types/wlr_tablet_v2.h>
#include <wlr/util/log.h>
#include "util/array.h"
#include "util/signal.h"
#include "util/time.h"
#include "tablet-unstable-v2-protocol.h"
@ -47,7 +46,7 @@ static void handle_tablet_tool_v2_set_cursor(struct wl_client *client,
.seat_client = tool->seat->seat_client,
};
wlr_signal_emit_safe(&tool->tool->events.set_cursor, &evt);
wl_signal_emit_mutable(&tool->tool->events.set_cursor, &evt);
}
static void handle_tablet_tool_v2_destroy(struct wl_client *client,

View file

@ -9,7 +9,6 @@
#include <wlr/util/log.h>
#include "render/pixel_format.h"
#include "types/wlr_buffer.h"
#include "util/signal.h"
void wlr_buffer_init(struct wlr_buffer *buffer,
const struct wlr_buffer_impl *impl, int width, int height) {
@ -34,7 +33,7 @@ static void buffer_consider_destroy(struct wlr_buffer *buffer) {
assert(!buffer->accessing_data_ptr);
wlr_signal_emit_safe(&buffer->events.destroy, NULL);
wl_signal_emit_mutable(&buffer->events.destroy, NULL);
wlr_addon_set_finish(&buffer->addons);
buffer->impl->destroy(buffer);
@ -64,7 +63,7 @@ void wlr_buffer_unlock(struct wlr_buffer *buffer) {
buffer->n_locks--;
if (buffer->n_locks == 0) {
wlr_signal_emit_safe(&buffer->events.release, NULL);
wl_signal_emit_mutable(&buffer->events.release, NULL);
}
buffer_consider_destroy(buffer);

View file

@ -12,7 +12,6 @@
#include <wlr/util/region.h>
#include "types/wlr_buffer.h"
#include "types/wlr_region.h"
#include "util/signal.h"
#include "util/time.h"
#define COMPOSITOR_VERSION 5
@ -492,7 +491,7 @@ static void surface_commit_state(struct wlr_surface *surface,
surface->role->commit(surface);
}
wlr_signal_emit_safe(&surface->events.commit, surface);
wl_signal_emit_mutable(&surface->events.commit, surface);
}
static void collect_subsurface_damage_iter(struct wlr_surface *surface,
@ -531,7 +530,7 @@ static void subsurface_parent_commit(struct wlr_subsurface *subsurface) {
if (!subsurface->added) {
subsurface->added = true;
wlr_signal_emit_safe(&subsurface->parent->events.new_subsurface,
wl_signal_emit_mutable(&subsurface->parent->events.new_subsurface,
subsurface);
}
}
@ -541,7 +540,7 @@ static void surface_handle_commit(struct wl_client *client,
struct wlr_surface *surface = wlr_surface_from_resource(resource);
surface_finalize_pending(surface);
wlr_signal_emit_safe(&surface->events.client_commit, NULL);
wl_signal_emit_mutable(&surface->events.client_commit, NULL);
if (surface->pending.cached_state_locks > 0 || !wl_list_empty(&surface->cached)) {
surface_cache_pending(surface);
@ -667,7 +666,7 @@ static void surface_handle_resource_destroy(struct wl_resource *resource) {
surface_output_destroy(surface_output);
}
wlr_signal_emit_safe(&surface->events.destroy, surface);
wl_signal_emit_mutable(&surface->events.destroy, surface);
wlr_addon_set_finish(&surface->addons);
@ -1126,7 +1125,7 @@ static void compositor_create_surface(struct wl_client *client,
return;
}
wlr_signal_emit_safe(&compositor->events.new_surface, surface);
wl_signal_emit_mutable(&compositor->events.new_surface, surface);
}
static void compositor_create_region(struct wl_client *client,
@ -1156,7 +1155,7 @@ static void compositor_handle_display_destroy(
struct wl_listener *listener, void *data) {
struct wlr_compositor *compositor =
wl_container_of(listener, compositor, display_destroy);
wlr_signal_emit_safe(&compositor->events.destroy, NULL);
wl_signal_emit_mutable(&compositor->events.destroy, NULL);
wl_list_remove(&compositor->display_destroy.link);
wl_global_destroy(compositor->global);
free(compositor);

View file

@ -12,7 +12,6 @@
#include <wlr/types/wlr_touch.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
#include "util/signal.h"
struct wlr_cursor_device {
struct wlr_cursor *cursor;
@ -368,7 +367,7 @@ static void handle_pointer_motion(struct wl_listener *listener, void *data) {
struct wlr_pointer_motion_event *event = data;
struct wlr_cursor_device *device =
wl_container_of(listener, device, motion);
wlr_signal_emit_safe(&device->cursor->events.motion, event);
wl_signal_emit_mutable(&device->cursor->events.motion, event);
}
static void apply_output_transform(double *x, double *y,
@ -440,80 +439,80 @@ static void handle_pointer_motion_absolute(struct wl_listener *listener,
if (output) {
apply_output_transform(&event->x, &event->y, output->transform);
}
wlr_signal_emit_safe(&device->cursor->events.motion_absolute, event);
wl_signal_emit_mutable(&device->cursor->events.motion_absolute, event);
}
static void handle_pointer_button(struct wl_listener *listener, void *data) {
struct wlr_pointer_button_event *event = data;
struct wlr_cursor_device *device =
wl_container_of(listener, device, button);
wlr_signal_emit_safe(&device->cursor->events.button, event);
wl_signal_emit_mutable(&device->cursor->events.button, event);
}
static void handle_pointer_axis(struct wl_listener *listener, void *data) {
struct wlr_pointer_axis_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, axis);
wlr_signal_emit_safe(&device->cursor->events.axis, event);
wl_signal_emit_mutable(&device->cursor->events.axis, event);
}
static void handle_pointer_frame(struct wl_listener *listener, void *data) {
struct wlr_cursor_device *device = wl_container_of(listener, device, frame);
wlr_signal_emit_safe(&device->cursor->events.frame, device->cursor);
wl_signal_emit_mutable(&device->cursor->events.frame, device->cursor);
}
static void handle_pointer_swipe_begin(struct wl_listener *listener, void *data) {
struct wlr_pointer_swipe_begin_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, swipe_begin);
wlr_signal_emit_safe(&device->cursor->events.swipe_begin, event);
wl_signal_emit_mutable(&device->cursor->events.swipe_begin, event);
}
static void handle_pointer_swipe_update(struct wl_listener *listener, void *data) {
struct wlr_pointer_swipe_update_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, swipe_update);
wlr_signal_emit_safe(&device->cursor->events.swipe_update, event);
wl_signal_emit_mutable(&device->cursor->events.swipe_update, event);
}
static void handle_pointer_swipe_end(struct wl_listener *listener, void *data) {
struct wlr_pointer_swipe_end_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, swipe_end);
wlr_signal_emit_safe(&device->cursor->events.swipe_end, event);
wl_signal_emit_mutable(&device->cursor->events.swipe_end, event);
}
static void handle_pointer_pinch_begin(struct wl_listener *listener, void *data) {
struct wlr_pointer_pinch_begin_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, pinch_begin);
wlr_signal_emit_safe(&device->cursor->events.pinch_begin, event);
wl_signal_emit_mutable(&device->cursor->events.pinch_begin, event);
}
static void handle_pointer_pinch_update(struct wl_listener *listener, void *data) {
struct wlr_pointer_pinch_update_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, pinch_update);
wlr_signal_emit_safe(&device->cursor->events.pinch_update, event);
wl_signal_emit_mutable(&device->cursor->events.pinch_update, event);
}
static void handle_pointer_pinch_end(struct wl_listener *listener, void *data) {
struct wlr_pointer_pinch_end_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, pinch_end);
wlr_signal_emit_safe(&device->cursor->events.pinch_end, event);
wl_signal_emit_mutable(&device->cursor->events.pinch_end, event);
}
static void handle_pointer_hold_begin(struct wl_listener *listener, void *data) {
struct wlr_pointer_hold_begin_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, hold_begin);
wlr_signal_emit_safe(&device->cursor->events.hold_begin, event);
wl_signal_emit_mutable(&device->cursor->events.hold_begin, event);
}
static void handle_pointer_hold_end(struct wl_listener *listener, void *data) {
struct wlr_pointer_hold_end_event *event = data;
struct wlr_cursor_device *device = wl_container_of(listener, device, hold_end);
wlr_signal_emit_safe(&device->cursor->events.hold_end, event);
wl_signal_emit_mutable(&device->cursor->events.hold_end, event);
}
static void handle_touch_up(struct wl_listener *listener, void *data) {
struct wlr_touch_up_event *event = data;
struct wlr_cursor_device *device;
device = wl_container_of(listener, device, touch_up);
wlr_signal_emit_safe(&device->cursor->events.touch_up, event);
wl_signal_emit_mutable(&device->cursor->events.touch_up, event);
}
static void handle_touch_down(struct wl_listener *listener, void *data) {
@ -526,7 +525,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
if (output) {
apply_output_transform(&event->x, &event->y, output->transform);
}
wlr_signal_emit_safe(&device->cursor->events.touch_down, event);
wl_signal_emit_mutable(&device->cursor->events.touch_down, event);
}
static void handle_touch_motion(struct wl_listener *listener, void *data) {
@ -539,20 +538,20 @@ static void handle_touch_motion(struct wl_listener *listener, void *data) {
if (output) {
apply_output_transform(&event->x, &event->y, output->transform);
}
wlr_signal_emit_safe(&device->cursor->events.touch_motion, event);
wl_signal_emit_mutable(&device->cursor->events.touch_motion, event);
}
static void handle_touch_cancel(struct wl_listener *listener, void *data) {
struct wlr_touch_cancel_event *event = data;
struct wlr_cursor_device *device;
device = wl_container_of(listener, device, touch_cancel);
wlr_signal_emit_safe(&device->cursor->events.touch_cancel, event);
wl_signal_emit_mutable(&device->cursor->events.touch_cancel, event);
}
static void handle_touch_frame(struct wl_listener *listener, void *data) {
struct wlr_cursor_device *device =
wl_container_of(listener, device, touch_frame);
wlr_signal_emit_safe(&device->cursor->events.touch_frame, NULL);
wl_signal_emit_mutable(&device->cursor->events.touch_frame, NULL);
}
static void handle_tablet_tool_tip(struct wl_listener *listener, void *data) {
@ -565,7 +564,7 @@ static void handle_tablet_tool_tip(struct wl_listener *listener, void *data) {
if (output) {
apply_output_transform(&event->x, &event->y, output->transform);
}
wlr_signal_emit_safe(&device->cursor->events.tablet_tool_tip, event);
wl_signal_emit_mutable(&device->cursor->events.tablet_tool_tip, event);
}
static void handle_tablet_tool_axis(struct wl_listener *listener, void *data) {
@ -600,7 +599,7 @@ static void handle_tablet_tool_axis(struct wl_listener *listener, void *data) {
}
}
wlr_signal_emit_safe(&device->cursor->events.tablet_tool_axis, event);
wl_signal_emit_mutable(&device->cursor->events.tablet_tool_axis, event);
}
static void handle_tablet_tool_button(struct wl_listener *listener,
@ -608,7 +607,7 @@ static void handle_tablet_tool_button(struct wl_listener *listener,
struct wlr_tablet_tool_button *event = data;
struct wlr_cursor_device *device;
device = wl_container_of(listener, device, tablet_tool_button);
wlr_signal_emit_safe(&device->cursor->events.tablet_tool_button, event);
wl_signal_emit_mutable(&device->cursor->events.tablet_tool_button, event);
}
static void handle_tablet_tool_proximity(struct wl_listener *listener,
@ -622,7 +621,7 @@ static void handle_tablet_tool_proximity(struct wl_listener *listener,
if (output) {
apply_output_transform(&event->x, &event->y, output->transform);
}
wlr_signal_emit_safe(&device->cursor->events.tablet_tool_proximity, event);
wl_signal_emit_mutable(&device->cursor->events.tablet_tool_proximity, event);
}
static void handle_device_destroy(struct wl_listener *listener, void *data) {

View file

@ -4,7 +4,6 @@
#include <pixman.h>
#include <wlr/types/wlr_damage_ring.h>
#include <wlr/util/box.h>
#include "util/signal.h"
#define WLR_DAMAGE_RING_MAX_RECTS 20

View file

@ -7,7 +7,6 @@
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-data-control-unstable-v1-protocol.h"
#define DATA_CONTROL_MANAGER_VERSION 2
@ -628,7 +627,7 @@ static void manager_handle_get_data_device(struct wl_client *client,
&device->seat_set_primary_selection);
wl_list_insert(&manager->devices, &device->link);
wlr_signal_emit_safe(&manager->events.new_device, device);
wl_signal_emit_mutable(&manager->events.new_device, device);
// At this point maybe the compositor decided to destroy the device. If
// it's the case then the resource will be inert.
@ -666,7 +665,7 @@ static void manager_bind(struct wl_client *client, void *data, uint32_t version,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_data_control_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -11,7 +11,6 @@
#include <wlr/types/wlr_drm.h>
#include <wlr/util/log.h>
#include "drm-protocol.h"
#include "util/signal.h"
#define WLR_DRM_VERSION 2
@ -172,7 +171,7 @@ static void drm_bind(struct wl_client *client, void *data,
}
static void drm_destroy(struct wlr_drm *drm) {
wlr_signal_emit_safe(&drm->events.destroy, NULL);
wl_signal_emit_mutable(&drm->events.destroy, NULL);
wl_list_remove(&drm->display_destroy.link);
wl_list_remove(&drm->renderer_destroy.link);

View file

@ -9,7 +9,6 @@
#include <wlr/util/log.h>
#include "backend/drm/drm.h"
#include "drm-lease-v1-protocol.h"
#include "util/signal.h"
#include "util/global.h"
#define DRM_LEASE_DEVICE_V1_VERSION 1
@ -353,7 +352,7 @@ static void drm_lease_request_v1_handle_submit(
request->lease = lease;
/* TODO: reject the request if the user does not grant it */
wlr_signal_emit_safe(&request->device->manager->events.request,
wl_signal_emit_mutable(&request->device->manager->events.request,
request);
/* Request is done */

View file

@ -6,7 +6,6 @@
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_output.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-export-dmabuf-unstable-v1-protocol.h"
#define EXPORT_DMABUF_MANAGER_VERSION 1
@ -182,7 +181,7 @@ static void manager_bind(struct wl_client *client, void *data, uint32_t version,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_export_dmabuf_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -7,7 +7,6 @@
#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-foreign-toplevel-management-unstable-v1-protocol.h"
#define FOREIGN_TOPLEVEL_MANAGEMENT_V1_VERSION 3
@ -33,7 +32,7 @@ static void toplevel_handle_send_maximized_event(struct wl_resource *resource,
.toplevel = toplevel,
.maximized = state,
};
wlr_signal_emit_safe(&toplevel->events.request_maximize, &event);
wl_signal_emit_mutable(&toplevel->events.request_maximize, &event);
}
static void foreign_toplevel_handle_set_maximized(struct wl_client *client,
@ -58,7 +57,7 @@ static void toplevel_send_minimized_event(struct wl_resource *resource,
.toplevel = toplevel,
.minimized = state,
};
wlr_signal_emit_safe(&toplevel->events.request_minimize, &event);
wl_signal_emit_mutable(&toplevel->events.request_minimize, &event);
}
static void foreign_toplevel_handle_set_minimized(struct wl_client *client,
@ -88,7 +87,7 @@ static void toplevel_send_fullscreen_event(struct wl_resource *resource,
.fullscreen = state,
.output = output,
};
wlr_signal_emit_safe(&toplevel->events.request_fullscreen, &event);
wl_signal_emit_mutable(&toplevel->events.request_fullscreen, &event);
}
static void foreign_toplevel_handle_set_fullscreen(struct wl_client *client,
@ -117,7 +116,7 @@ static void foreign_toplevel_handle_activate(struct wl_client *client,
.toplevel = toplevel,
.seat = seat_client->seat,
};
wlr_signal_emit_safe(&toplevel->events.request_activate, &event);
wl_signal_emit_mutable(&toplevel->events.request_activate, &event);
}
static void foreign_toplevel_handle_close(struct wl_client *client,
@ -127,7 +126,7 @@ static void foreign_toplevel_handle_close(struct wl_client *client,
if (!toplevel) {
return;
}
wlr_signal_emit_safe(&toplevel->events.request_close, toplevel);
wl_signal_emit_mutable(&toplevel->events.request_close, toplevel);
}
static void foreign_toplevel_handle_set_rectangle(struct wl_client *client,
@ -154,7 +153,7 @@ static void foreign_toplevel_handle_set_rectangle(struct wl_client *client,
.width = width,
.height = height,
};
wlr_signal_emit_safe(&toplevel->events.set_rectangle, &event);
wl_signal_emit_mutable(&toplevel->events.set_rectangle, &event);
}
static void foreign_toplevel_handle_destroy(struct wl_client *client,
@ -495,7 +494,7 @@ void wlr_foreign_toplevel_handle_v1_destroy(
return;
}
wlr_signal_emit_safe(&toplevel->events.destroy, toplevel);
wl_signal_emit_mutable(&toplevel->events.destroy, toplevel);
struct wl_resource *resource, *tmp;
wl_resource_for_each_safe(resource, tmp, &toplevel->resources) {
@ -678,7 +677,7 @@ static void foreign_toplevel_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_foreign_toplevel_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -4,7 +4,6 @@
#include <wlr/types/wlr_fullscreen_shell_v1.h>
#include <wlr/types/wlr_output.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#define FULLSCREEN_SHELL_VERSION 1
@ -37,7 +36,7 @@ static void shell_handle_present_surface(struct wl_client *client,
.method = method,
.output = output,
};
wlr_signal_emit_safe(&shell->events.present_surface, &event);
wl_signal_emit_mutable(&shell->events.present_surface, &event);
}
static void shell_handle_present_surface_for_mode(struct wl_client *client,
@ -79,7 +78,7 @@ static void shell_bind(struct wl_client *client, void *data, uint32_t version,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_fullscreen_shell_v1 *shell =
wl_container_of(listener, shell, display_destroy);
wlr_signal_emit_safe(&shell->events.destroy, shell);
wl_signal_emit_mutable(&shell->events.destroy, shell);
wl_list_remove(&shell->display_destroy.link);
wl_global_destroy(shell->global);
free(shell);

View file

@ -7,7 +7,6 @@
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_output.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-gamma-control-unstable-v1-protocol.h"
#define GAMMA_CONTROL_MANAGER_V1_VERSION 1
@ -259,7 +258,7 @@ static void gamma_control_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_gamma_control_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -5,7 +5,6 @@
#include <wlr/types/wlr_idle.h>
#include <wlr/util/log.h>
#include "idle-protocol.h"
#include "util/signal.h"
static const struct org_kde_kwin_idle_timeout_interface idle_timeout_impl;
@ -22,7 +21,7 @@ static int idle_notify(void *data) {
return 0;
}
timer->idle_state = true;
wlr_signal_emit_safe(&timer->events.idle, timer);
wl_signal_emit_mutable(&timer->events.idle, timer);
if (timer->resource) {
org_kde_kwin_idle_timeout_send_idle(timer->resource);
@ -38,7 +37,7 @@ static void handle_activity(struct wlr_idle_timeout *timer) {
// in case the previous state was sleeping send a resume event and switch state
if (timer->idle_state) {
timer->idle_state = false;
wlr_signal_emit_safe(&timer->events.resume, timer);
wl_signal_emit_mutable(&timer->events.resume, timer);
if (timer->resource) {
org_kde_kwin_idle_timeout_send_resumed(timer->resource);
@ -212,7 +211,7 @@ static void idle_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_idle *idle = wl_container_of(listener, idle, display_destroy);
wlr_signal_emit_safe(&idle->events.destroy, idle);
wl_signal_emit_mutable(&idle->events.destroy, idle);
wl_list_remove(&idle->display_destroy.link);
wl_global_destroy(idle->global);
free(idle);
@ -249,7 +248,7 @@ struct wlr_idle *wlr_idle_create(struct wl_display *display) {
}
void wlr_idle_notify_activity(struct wlr_idle *idle, struct wlr_seat *seat) {
wlr_signal_emit_safe(&idle->events.activity_notify, seat);
wl_signal_emit_mutable(&idle->events.activity_notify, seat);
}
struct wlr_idle_timeout *wlr_idle_timeout_create(struct wlr_idle *idle,
@ -258,7 +257,7 @@ struct wlr_idle_timeout *wlr_idle_timeout_create(struct wlr_idle *idle,
}
void wlr_idle_timeout_destroy(struct wlr_idle_timeout *timer) {
wlr_signal_emit_safe(&timer->events.destroy, NULL);
wl_signal_emit_mutable(&timer->events.destroy, NULL);
wl_list_remove(&timer->input_listener.link);
wl_list_remove(&timer->seat_destroy.link);

View file

@ -1,6 +1,5 @@
#include <assert.h>
#include <stdlib.h>
#include <util/signal.h>
#include <wayland-server-core.h>
#include <wayland-util.h>
#include <wlr/types/wlr_compositor.h>
@ -33,7 +32,7 @@ static void idle_inhibitor_v1_destroy(struct wlr_idle_inhibitor_v1 *inhibitor) {
return;
}
wlr_signal_emit_safe(&inhibitor->events.destroy, inhibitor->surface);
wl_signal_emit_mutable(&inhibitor->events.destroy, inhibitor->surface);
wl_resource_set_user_data(inhibitor->resource, NULL);
wl_list_remove(&inhibitor->link);
@ -98,7 +97,7 @@ static void manager_handle_create_inhibitor(struct wl_client *client,
inhibitor, idle_inhibitor_v1_handle_resource_destroy);
wl_list_insert(&manager->inhibitors, &inhibitor->link);
wlr_signal_emit_safe(&manager->events.new_inhibitor, inhibitor);
wl_signal_emit_mutable(&manager->events.new_inhibitor, inhibitor);
}
static void manager_handle_destroy(struct wl_client *client,
@ -114,7 +113,7 @@ static const struct zwp_idle_inhibit_manager_v1_interface idle_inhibit_impl = {
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_idle_inhibit_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -3,7 +3,6 @@
#include <stdlib.h>
#include <string.h>
#include "interfaces/wlr_input_device.h"
#include "util/signal.h"
void wlr_input_device_init(struct wlr_input_device *dev,
enum wlr_input_device_type type, const char *name) {
@ -21,7 +20,7 @@ void wlr_input_device_finish(struct wlr_input_device *wlr_device) {
return;
}
wlr_signal_emit_safe(&wlr_device->events.destroy, wlr_device);
wl_signal_emit_mutable(&wlr_device->events.destroy, wlr_device);
wl_list_remove(&wlr_device->events.destroy.listener_list);

View file

@ -4,7 +4,6 @@
#include <wayland-server-core.h>
#include "wlr/types/wlr_input_inhibitor.h"
#include "wlr-input-inhibitor-unstable-v1-protocol.h"
#include "util/signal.h"
static const struct zwlr_input_inhibit_manager_v1_interface inhibit_manager_implementation;
static const struct zwlr_input_inhibitor_v1_interface input_inhibitor_implementation;
@ -27,7 +26,7 @@ static void input_inhibit_manager_deactivate(
}
manager->active_client = NULL;
manager->active_inhibitor = NULL;
wlr_signal_emit_safe(&manager->events.deactivate, manager);
wl_signal_emit_mutable(&manager->events.deactivate, manager);
}
static void input_inhibitor_destroy(struct wl_client *client,
@ -71,7 +70,7 @@ static void inhibit_manager_get_inhibitor(struct wl_client *client,
manager->active_client = client;
manager->active_inhibitor = wl_resource;
wlr_signal_emit_safe(&manager->events.activate, manager);
wl_signal_emit_mutable(&manager->events.activate, manager);
}
static const struct zwlr_input_inhibit_manager_v1_interface inhibit_manager_implementation = {
@ -106,7 +105,7 @@ static void inhibit_manager_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_input_inhibit_manager *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -12,7 +12,6 @@
#include <xkbcommon/xkbcommon.h>
#include "input-method-unstable-v2-protocol.h"
#include "util/shm.h"
#include "util/signal.h"
static const struct zwp_input_method_v2_interface input_method_impl;
static const struct zwp_input_method_keyboard_grab_v2_interface keyboard_grab_impl;
@ -41,7 +40,7 @@ static void input_method_destroy(struct wlr_input_method_v2 *input_method) {
popup_surface, tmp, &input_method->popup_surfaces, link) {
popup_surface_destroy(popup_surface);
}
wlr_signal_emit_safe(&input_method->events.destroy, input_method);
wl_signal_emit_mutable(&input_method->events.destroy, input_method);
wl_list_remove(wl_resource_get_link(input_method->resource));
wl_list_remove(&input_method->seat_client_destroy.link);
wlr_input_method_keyboard_grab_v2_destroy(input_method->keyboard_grab);
@ -76,7 +75,7 @@ static void im_commit(struct wl_client *client, struct wl_resource *resource,
input_method->current_serial = serial;
struct wlr_input_method_v2_state default_state = {0};
input_method->pending = default_state;
wlr_signal_emit_safe(&input_method->events.commit, (void*)input_method);
wl_signal_emit_mutable(&input_method->events.commit, (void*)input_method);
}
static void im_commit_string(struct wl_client *client,
@ -141,10 +140,10 @@ static void popup_surface_set_mapped(
struct wlr_input_popup_surface_v2 *popup_surface, bool mapped) {
if (mapped && !popup_surface->mapped) {
popup_surface->mapped = true;
wlr_signal_emit_safe(&popup_surface->events.map, popup_surface);
wl_signal_emit_mutable(&popup_surface->events.map, popup_surface);
} else if (!mapped && popup_surface->mapped) {
popup_surface->mapped = false;
wlr_signal_emit_safe(&popup_surface->events.unmap, popup_surface);
wl_signal_emit_mutable(&popup_surface->events.unmap, popup_surface);
}
}
@ -182,7 +181,7 @@ bool wlr_surface_is_input_popup_surface_v2(struct wlr_surface *surface) {
static void popup_surface_destroy(
struct wlr_input_popup_surface_v2 *popup_surface) {
popup_surface_set_mapped(popup_surface, false);
wlr_signal_emit_safe(&popup_surface->events.destroy, NULL);
wl_signal_emit_mutable(&popup_surface->events.destroy, NULL);
wl_list_remove(&popup_surface->surface_destroy.link);
wl_list_remove(&popup_surface->link);
wl_resource_set_user_data(popup_surface->resource, NULL);
@ -264,7 +263,7 @@ static void im_get_input_popup_surface(struct wl_client *client,
&& popup_surface->input_method->client_active);
wl_list_insert(&input_method->popup_surfaces, &popup_surface->link);
wlr_signal_emit_safe(&input_method->events.new_popup_surface, popup_surface);
wl_signal_emit_mutable(&input_method->events.new_popup_surface, popup_surface);
}
void wlr_input_method_keyboard_grab_v2_destroy(
@ -272,7 +271,7 @@ void wlr_input_method_keyboard_grab_v2_destroy(
if (!keyboard_grab) {
return;
}
wlr_signal_emit_safe(&keyboard_grab->events.destroy, keyboard_grab);
wl_signal_emit_mutable(&keyboard_grab->events.destroy, keyboard_grab);
keyboard_grab->input_method->keyboard_grab = NULL;
if (keyboard_grab->keyboard) {
wl_list_remove(&keyboard_grab->keyboard_keymap.link);
@ -452,7 +451,7 @@ static void im_grab_keyboard(struct wl_client *client,
keyboard_grab->input_method = input_method;
input_method->keyboard_grab = keyboard_grab;
wl_signal_init(&keyboard_grab->events.destroy);
wlr_signal_emit_safe(&input_method->events.grab_keyboard, keyboard_grab);
wl_signal_emit_mutable(&input_method->events.grab_keyboard, keyboard_grab);
}
static const struct zwp_input_method_v2_interface input_method_impl = {
@ -575,7 +574,7 @@ static void manager_get_input_method(struct wl_client *client,
input_method->resource = im_resource;
wl_list_insert(&im_manager->input_methods,
wl_resource_get_link(input_method->resource));
wlr_signal_emit_safe(&im_manager->events.input_method, input_method);
wl_signal_emit_mutable(&im_manager->events.input_method, input_method);
}
static void manager_destroy(struct wl_client *client,
@ -607,7 +606,7 @@ static void input_method_manager_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_input_method_manager_v2 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -10,7 +10,6 @@
#include "types/wlr_keyboard.h"
#include "util/array.h"
#include "util/shm.h"
#include "util/signal.h"
#include "util/time.h"
struct wlr_keyboard *wlr_keyboard_from_input_device(
@ -91,7 +90,7 @@ void wlr_keyboard_notify_modifiers(struct wlr_keyboard *keyboard,
bool updated = keyboard_modifier_update(keyboard);
if (updated) {
wlr_signal_emit_safe(&keyboard->events.modifiers, keyboard);
wl_signal_emit_mutable(&keyboard->events.modifiers, keyboard);
}
keyboard_led_update(keyboard);
@ -100,7 +99,7 @@ void wlr_keyboard_notify_modifiers(struct wlr_keyboard *keyboard,
void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
struct wlr_keyboard_key_event *event) {
keyboard_key_update(keyboard, event);
wlr_signal_emit_safe(&keyboard->events.key, event);
wl_signal_emit_mutable(&keyboard->events.key, event);
if (keyboard->xkb_state == NULL) {
return;
@ -114,7 +113,7 @@ void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
bool updated = keyboard_modifier_update(keyboard);
if (updated) {
wlr_signal_emit_safe(&keyboard->events.modifiers, keyboard);
wl_signal_emit_mutable(&keyboard->events.modifiers, keyboard);
}
keyboard_led_update(keyboard);
@ -246,7 +245,7 @@ bool wlr_keyboard_set_keymap(struct wlr_keyboard *kb,
keyboard_modifier_update(kb);
wlr_signal_emit_safe(&kb->events.keymap, kb);
wl_signal_emit_mutable(&kb->events.keymap, kb);
return true;
err:
@ -266,7 +265,7 @@ void wlr_keyboard_set_repeat_info(struct wlr_keyboard *kb, int32_t rate,
}
kb->repeat_info.rate = rate;
kb->repeat_info.delay = delay;
wlr_signal_emit_safe(&kb->events.repeat_info, kb);
wl_signal_emit_mutable(&kb->events.repeat_info, kb);
}
uint32_t wlr_keyboard_get_modifiers(struct wlr_keyboard *kb) {

View file

@ -7,7 +7,6 @@
#include <wayland-server-protocol.h>
#include <xkbcommon/xkbcommon.h>
#include "types/wlr_keyboard.h"
#include "util/signal.h"
#include "wlr/interfaces/wlr_keyboard.h"
#include "wlr/types/wlr_keyboard.h"
#include "wlr/types/wlr_keyboard_group.h"
@ -212,9 +211,9 @@ static void refresh_state(struct keyboard_group_device *device,
// If there are any unique keys, emit the enter/leave event
if (keys.size > 0) {
if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
wlr_signal_emit_safe(&device->keyboard->group->events.enter, &keys);
wl_signal_emit_mutable(&device->keyboard->group->events.enter, &keys);
} else {
wlr_signal_emit_safe(&device->keyboard->group->events.leave, &keys);
wl_signal_emit_mutable(&device->keyboard->group->events.leave, &keys);
}
}

View file

@ -1,6 +1,5 @@
#include <assert.h>
#include <stdlib.h>
#include <util/signal.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
#include "keyboard-shortcuts-inhibit-unstable-v1-protocol.h"
@ -35,7 +34,7 @@ static void keyboard_shortcuts_inhibitor_v1_destroy(
return;
}
wlr_signal_emit_safe(&inhibitor->events.destroy, inhibitor);
wl_signal_emit_mutable(&inhibitor->events.destroy, inhibitor);
wl_resource_set_user_data(inhibitor->resource, NULL);
wl_list_remove(&inhibitor->link);
@ -144,7 +143,7 @@ static void manager_handle_inhibit_shortcuts(struct wl_client *client,
keyboard_shortcuts_inhibitor_v1_handle_resource_destroy);
wl_list_insert(&manager->inhibitors, &inhibitor->link);
wlr_signal_emit_safe(&manager->events.new_inhibitor, inhibitor);
wl_signal_emit_mutable(&manager->events.new_inhibitor, inhibitor);
}
static void manager_handle_destroy(struct wl_client *client,
@ -161,7 +160,7 @@ keyboard_shortcuts_inhibit_impl = {
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_keyboard_shortcuts_inhibit_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -8,7 +8,6 @@
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-layer-shell-unstable-v1-protocol.h"
#define LAYER_SHELL_VERSION 4
@ -223,7 +222,7 @@ static void layer_surface_handle_get_popup(struct wl_client *client,
}
popup->parent = parent->surface;
wl_list_insert(&parent->popups, &popup->link);
wlr_signal_emit_safe(&parent->events.new_popup, popup);
wl_signal_emit_mutable(&parent->events.new_popup, popup);
}
static void layer_surface_set_layer(struct wl_client *client,
@ -265,7 +264,7 @@ static void layer_surface_unmap(struct wlr_layer_surface_v1 *surface) {
surface->configured = surface->mapped = false;
// TODO: probably need to ungrab before this event
wlr_signal_emit_safe(&surface->events.unmap, surface);
wl_signal_emit_mutable(&surface->events.unmap, surface);
struct wlr_xdg_popup *popup, *popup_tmp;
wl_list_for_each_safe(popup, popup_tmp, &surface->popups, link) {
@ -283,7 +282,7 @@ static void layer_surface_destroy(struct wlr_layer_surface_v1 *surface) {
if (surface->configured && surface->mapped) {
layer_surface_unmap(surface);
}
wlr_signal_emit_safe(&surface->events.destroy, surface);
wl_signal_emit_mutable(&surface->events.destroy, surface);
wl_resource_set_user_data(surface->resource, NULL);
surface->surface->role_data = NULL;
wl_list_remove(&surface->surface_destroy.link);
@ -365,7 +364,7 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
surface->added = true;
assert(!surface->configured);
assert(!surface->mapped);
wlr_signal_emit_safe(&surface->shell->events.new_surface, surface);
wl_signal_emit_mutable(&surface->shell->events.new_surface, surface);
// Return early here as the compositor may have closed this layer surface
// in response to the new_surface event.
return;
@ -374,7 +373,7 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
if (surface->configured && wlr_surface_has_buffer(surface->surface) &&
!surface->mapped) {
surface->mapped = true;
wlr_signal_emit_safe(&surface->events.map, surface);
wl_signal_emit_mutable(&surface->events.map, surface);
}
}
@ -501,7 +500,7 @@ static void layer_shell_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_layer_shell_v1 *layer_shell =
wl_container_of(listener, layer_shell, display_destroy);
wlr_signal_emit_safe(&layer_shell->events.destroy, layer_shell);
wl_signal_emit_mutable(&layer_shell->events.destroy, layer_shell);
wl_list_remove(&layer_shell->display_destroy.link);
wl_global_destroy(layer_shell->global);
free(layer_shell);

View file

@ -11,7 +11,6 @@
#include <wlr/util/log.h>
#include "linux-dmabuf-unstable-v1-protocol.h"
#include "render/drm_format_set.h"
#include "util/signal.h"
#include "util/shm.h"
#define LINUX_DMABUF_VERSION 4
@ -887,7 +886,7 @@ static void linux_dmabuf_bind(struct wl_client *client, void *data,
}
static void linux_dmabuf_v1_destroy(struct wlr_linux_dmabuf_v1 *linux_dmabuf) {
wlr_signal_emit_safe(&linux_dmabuf->events.destroy, linux_dmabuf);
wl_signal_emit_mutable(&linux_dmabuf->events.destroy, linux_dmabuf);
struct wlr_linux_dmabuf_v1_surface *surface, *surface_tmp;
wl_list_for_each_safe(surface, surface_tmp, &linux_dmabuf->surfaces, link) {

View file

@ -5,7 +5,6 @@
#include <wlr/types/wlr_output_damage.h>
#include <wlr/types/wlr_output.h>
#include <wlr/util/box.h>
#include "util/signal.h"
static void output_handle_destroy(struct wl_listener *listener, void *data) {
struct wlr_output_damage *output_damage =
@ -41,7 +40,7 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
return;
}
wlr_signal_emit_safe(&output_damage->events.frame, output_damage);
wl_signal_emit_mutable(&output_damage->events.frame, output_damage);
}
static void output_handle_precommit(struct wl_listener *listener, void *data) {
@ -128,7 +127,7 @@ void wlr_output_damage_destroy(struct wlr_output_damage *output_damage) {
if (output_damage == NULL) {
return;
}
wlr_signal_emit_safe(&output_damage->events.destroy, output_damage);
wl_signal_emit_mutable(&output_damage->events.destroy, output_damage);
wl_list_remove(&output_damage->output_destroy.link);
wl_list_remove(&output_damage->output_mode.link);
wl_list_remove(&output_damage->output_needs_frame.link);

View file

@ -6,7 +6,6 @@
#include <wlr/types/wlr_output.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
#include "util/signal.h"
struct wlr_output_layout_output_state {
struct wlr_output_layout *layout;
@ -37,7 +36,7 @@ struct wlr_output_layout *wlr_output_layout_create(void) {
static void output_layout_output_destroy(
struct wlr_output_layout_output *l_output) {
wlr_signal_emit_safe(&l_output->events.destroy, l_output);
wl_signal_emit_mutable(&l_output->events.destroy, l_output);
wlr_output_destroy_global(l_output->output);
wl_list_remove(&l_output->state->mode.link);
wl_list_remove(&l_output->state->commit.link);
@ -52,7 +51,7 @@ void wlr_output_layout_destroy(struct wlr_output_layout *layout) {
return;
}
wlr_signal_emit_safe(&layout->events.destroy, layout);
wl_signal_emit_mutable(&layout->events.destroy, layout);
struct wlr_output_layout_output *l_output, *temp;
wl_list_for_each_safe(l_output, temp, &layout->outputs, link) {
@ -115,7 +114,7 @@ static void output_layout_reconfigure(struct wlr_output_layout *layout) {
max_x += output_box.width;
}
wlr_signal_emit_safe(&layout->events.change, layout);
wl_signal_emit_mutable(&layout->events.change, layout);
}
static void output_update_global(struct wlr_output *output) {
@ -211,7 +210,7 @@ void wlr_output_layout_add(struct wlr_output_layout *layout,
output_update_global(output);
if (is_new) {
wlr_signal_emit_safe(&layout->events.add, l_output);
wl_signal_emit_mutable(&layout->events.add, l_output);
}
}
@ -425,7 +424,7 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout,
output_update_global(output);
if (is_new) {
wlr_signal_emit_safe(&layout->events.add, l_output);
wl_signal_emit_mutable(&layout->events.add, l_output);
}
}

View file

@ -3,7 +3,6 @@
#include <stdlib.h>
#include <wlr/types/wlr_output_management_v1.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-output-management-unstable-v1-protocol.h"
#define OUTPUT_MANAGER_VERSION 2
@ -413,7 +412,7 @@ static void config_handle_apply(struct wl_client *client,
return;
}
wlr_signal_emit_safe(&config->manager->events.apply, config);
wl_signal_emit_mutable(&config->manager->events.apply, config);
}
static void config_handle_test(struct wl_client *client,
@ -432,7 +431,7 @@ static void config_handle_test(struct wl_client *client,
return;
}
wlr_signal_emit_safe(&config->manager->events.test, config);
wl_signal_emit_mutable(&config->manager->events.test, config);
}
static void config_handle_destroy(struct wl_client *client,
@ -589,7 +588,7 @@ static void manager_handle_display_destroy(struct wl_listener *listener,
void *data) {
struct wlr_output_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
struct wlr_output_head_v1 *head, *tmp;
wl_list_for_each_safe(head, tmp, &manager->heads, link) {

View file

@ -7,7 +7,6 @@
#include <wlr/types/wlr_output_power_management_v1.h>
#include <wlr/types/wlr_output.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-output-power-management-unstable-v1-protocol.h"
#define OUTPUT_POWER_MANAGER_V1_VERSION 1
@ -93,7 +92,7 @@ static void output_power_handle_set_mode(struct wl_client *client,
.output = output_power->output,
.mode = mode,
};
wlr_signal_emit_safe(&output_power->manager->events.set_mode, &event);
wl_signal_emit_mutable(&output_power->manager->events.set_mode, &event);
}
static const struct zwlr_output_power_v1_interface output_power_impl = {
@ -196,7 +195,7 @@ static void output_power_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_output_power_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_global_destroy(manager->global);
free(manager);
}

View file

@ -9,7 +9,6 @@
#include <wlr/types/wlr_region.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
#include "util/signal.h"
static const struct zwp_locked_pointer_v1_interface locked_pointer_impl;
static const struct zwp_confined_pointer_v1_interface confined_pointer_impl;
@ -47,7 +46,7 @@ static void pointer_constraint_destroy(struct wlr_pointer_constraint_v1 *constra
wlr_log(WLR_DEBUG, "destroying constraint %p", constraint);
wlr_signal_emit_safe(&constraint->events.destroy, constraint);
wl_signal_emit_mutable(&constraint->events.destroy, constraint);
wl_resource_set_user_data(constraint->resource, NULL);
wl_list_remove(&constraint->link);
@ -130,7 +129,7 @@ static void pointer_constraint_commit(
}
if (updated_region) {
wlr_signal_emit_safe(&constraint->events.set_region, NULL);
wl_signal_emit_mutable(&constraint->events.set_region, NULL);
}
}
@ -246,7 +245,7 @@ static void pointer_constraint_create(struct wl_client *client,
wl_list_insert(&pointer_constraints->constraints, &constraint->link);
wlr_signal_emit_safe(&pointer_constraints->events.new_constraint,
wl_signal_emit_mutable(&pointer_constraints->events.new_constraint,
constraint);
}

View file

@ -9,7 +9,6 @@
#include <wlr/types/wlr_pointer.h>
#include <wlr/types/wlr_pointer_gestures_v1.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "pointer-gestures-unstable-v1-protocol.h"
#define POINTER_GESTURES_VERSION 3

View file

@ -7,7 +7,6 @@
#include <wlr/types/wlr_presentation_time.h>
#include <wlr/util/addon.h>
#include "presentation-time-protocol.h"
#include "util/signal.h"
#define PRESENTATION_VERSION 1
@ -173,7 +172,7 @@ static void presentation_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_presentation *presentation =
wl_container_of(listener, presentation, display_destroy);
wlr_signal_emit_safe(&presentation->events.destroy, presentation);
wl_signal_emit_mutable(&presentation->events.destroy, presentation);
wl_list_remove(&presentation->display_destroy.link);
wl_global_destroy(presentation->global);
free(presentation);

View file

@ -2,7 +2,6 @@
#include <stdlib.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/util/log.h>
#include "util/signal.h"
void wlr_primary_selection_source_init(
struct wlr_primary_selection_source *source,
@ -20,7 +19,7 @@ void wlr_primary_selection_source_destroy(
return;
}
wlr_signal_emit_safe(&source->events.destroy, source);
wl_signal_emit_mutable(&source->events.destroy, source);
char **p;
wl_array_for_each(p, &source->mime_types) {
@ -63,7 +62,7 @@ void wlr_seat_request_set_primary_selection(struct wlr_seat *seat,
.source = source,
.serial = serial,
};
wlr_signal_emit_safe(&seat->events.request_set_primary_selection, &event);
wl_signal_emit_mutable(&seat->events.request_set_primary_selection, &event);
}
static void seat_handle_primary_selection_source_destroy(
@ -72,7 +71,7 @@ static void seat_handle_primary_selection_source_destroy(
wl_container_of(listener, seat, primary_selection_source_destroy);
wl_list_remove(&seat->primary_selection_source_destroy.link);
seat->primary_selection_source = NULL;
wlr_signal_emit_safe(&seat->events.set_primary_selection, seat);
wl_signal_emit_mutable(&seat->events.set_primary_selection, seat);
}
void wlr_seat_set_primary_selection(struct wlr_seat *seat,
@ -98,5 +97,5 @@ void wlr_seat_set_primary_selection(struct wlr_seat *seat,
&seat->primary_selection_source_destroy);
}
wlr_signal_emit_safe(&seat->events.set_primary_selection, seat);
wl_signal_emit_mutable(&seat->events.set_primary_selection, seat);
}

View file

@ -9,7 +9,6 @@
#include <wlr/types/wlr_seat.h>
#include <wlr/util/log.h>
#include "primary-selection-unstable-v1-protocol.h"
#include "util/signal.h"
#define DEVICE_MANAGER_VERSION 1
@ -458,7 +457,7 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
device_destroy(device);
}
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -1,7 +1,6 @@
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
#include <util/signal.h>
#include <wayland-server-core.h>
#include <wayland-util.h>
#include <wlr/types/wlr_relative_pointer_v1.h>
@ -27,7 +26,7 @@ static struct wlr_relative_pointer_manager_v1 *relative_pointer_manager_from_res
}
static void relative_pointer_destroy(struct wlr_relative_pointer_v1 *relative_pointer) {
wlr_signal_emit_safe(&relative_pointer->events.destroy, relative_pointer);
wl_signal_emit_mutable(&relative_pointer->events.destroy, relative_pointer);
wl_list_remove(&relative_pointer->link);
wl_list_remove(&relative_pointer->seat_destroy.link);
@ -118,7 +117,7 @@ static void relative_pointer_manager_v1_handle_get_relative_pointer(struct wl_cl
&relative_pointer->pointer_destroy);
relative_pointer->pointer_destroy.notify = relative_pointer_handle_pointer_destroy;
wlr_signal_emit_safe(&manager->events.new_relative_pointer,
wl_signal_emit_mutable(&manager->events.new_relative_pointer,
relative_pointer);
}
@ -140,7 +139,7 @@ static void relative_pointer_manager_v1_bind(struct wl_client *wl_client, void *
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_relative_pointer_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy_listener);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy_listener.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -12,7 +12,6 @@
#include <wlr/util/log.h>
#include "wlr-screencopy-unstable-v1-protocol.h"
#include "render/pixel_format.h"
#include "util/signal.h"
#define SCREENCOPY_MANAGER_VERSION 3
@ -680,7 +679,7 @@ failure:
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_screencopy_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -4,7 +4,6 @@
#include <wlr/types/wlr_server_decoration.h>
#include <wlr/util/log.h>
#include "server-decoration-protocol.h"
#include "util/signal.h"
static const struct org_kde_kwin_server_decoration_interface
server_decoration_impl;
@ -29,14 +28,14 @@ static void server_decoration_handle_request_mode(struct wl_client *client,
return;
}
decoration->mode = mode;
wlr_signal_emit_safe(&decoration->events.mode, decoration);
wl_signal_emit_mutable(&decoration->events.mode, decoration);
org_kde_kwin_server_decoration_send_mode(decoration->resource,
decoration->mode);
}
static void server_decoration_destroy(
struct wlr_server_decoration *decoration) {
wlr_signal_emit_safe(&decoration->events.destroy, decoration);
wl_signal_emit_mutable(&decoration->events.destroy, decoration);
wl_list_remove(&decoration->surface_destroy_listener.link);
wl_resource_set_user_data(decoration->resource, NULL);
wl_list_remove(&decoration->link);
@ -119,7 +118,7 @@ static void server_decoration_manager_handle_create(struct wl_client *client,
org_kde_kwin_server_decoration_send_mode(decoration->resource,
decoration->mode);
wlr_signal_emit_safe(&manager->events.new_decoration, decoration);
wl_signal_emit_mutable(&manager->events.new_decoration, decoration);
}
static const struct org_kde_kwin_server_decoration_manager_interface
@ -166,7 +165,7 @@ static void server_decoration_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_server_decoration_manager *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -6,7 +6,6 @@
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "ext-session-lock-v1-protocol.h"
#define SESSION_LOCK_VERSION 1
@ -157,7 +156,7 @@ static void lock_surface_role_commit(struct wlr_surface *surface) {
if (!lock_surface->mapped) {
lock_surface->mapped = true;
wlr_signal_emit_safe(&lock_surface->events.map, NULL);
wl_signal_emit_mutable(&lock_surface->events.map, NULL);
}
}
@ -185,7 +184,7 @@ static const struct wlr_surface_role lock_surface_role = {
static void lock_surface_destroy(
struct wlr_session_lock_surface_v1 *lock_surface) {
wlr_signal_emit_safe(&lock_surface->events.destroy, NULL);
wl_signal_emit_mutable(&lock_surface->events.destroy, NULL);
wl_list_remove(&lock_surface->link);
@ -312,7 +311,7 @@ static void lock_handle_get_lock_surface(struct wl_client *client,
wl_signal_add(&surface->events.destroy, &lock_surface->surface_destroy);
lock_surface->surface_destroy.notify = lock_surface_handle_surface_destroy;
wlr_signal_emit_safe(&lock->events.new_surface, lock_surface);
wl_signal_emit_mutable(&lock->events.new_surface, lock_surface);
}
static void lock_handle_unlock_and_destroy(struct wl_client *client,
@ -322,7 +321,7 @@ static void lock_handle_unlock_and_destroy(struct wl_client *client,
return;
}
wlr_signal_emit_safe(&lock->events.unlock, NULL);
wl_signal_emit_mutable(&lock->events.unlock, NULL);
wl_resource_destroy(lock_resource);
}
@ -344,7 +343,7 @@ static void lock_destroy(struct wlr_session_lock_v1 *lock) {
}
assert(wl_list_empty(&lock->surfaces));
wlr_signal_emit_safe(&lock->events.destroy, NULL);
wl_signal_emit_mutable(&lock->events.destroy, NULL);
assert(wl_list_empty(&lock->events.new_surface.listener_list));
assert(wl_list_empty(&lock->events.unlock.listener_list));
@ -395,7 +394,7 @@ static void lock_manager_handle_lock(struct wl_client *client,
wl_resource_set_implementation(lock->resource, &lock_implementation,
lock, lock_resource_destroy);
wlr_signal_emit_safe(&lock_manager->events.new_lock, lock);
wl_signal_emit_mutable(&lock_manager->events.new_lock, lock);
}
static const struct ext_session_lock_manager_v1_interface lock_manager_implementation = {
@ -420,7 +419,7 @@ static void lock_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_session_lock_manager_v1 *lock_manager =
wl_container_of(listener, lock_manager, display_destroy);
wlr_signal_emit_safe(&lock_manager->events.destroy, NULL);
wl_signal_emit_mutable(&lock_manager->events.destroy, NULL);
wl_list_remove(&lock_manager->display_destroy.link);
wl_global_destroy(lock_manager->global);

View file

@ -4,7 +4,6 @@
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_subcompositor.h>
#include "types/wlr_region.h"
#include "util/signal.h"
#define SUBCOMPOSITOR_VERSION 1
@ -37,7 +36,7 @@ static void subsurface_destroy(struct wlr_subsurface *subsurface) {
subsurface_unmap(subsurface);
wlr_signal_emit_safe(&subsurface->events.destroy, subsurface);
wl_signal_emit_mutable(&subsurface->events.destroy, subsurface);
wl_list_remove(&subsurface->surface_destroy.link);
wl_list_remove(&subsurface->surface_client_commit.link);
@ -230,7 +229,7 @@ static void subsurface_consider_map(struct wlr_subsurface *subsurface,
// Now we can map the subsurface
subsurface->mapped = true;
wlr_signal_emit_safe(&subsurface->events.map, subsurface);
wl_signal_emit_mutable(&subsurface->events.map, subsurface);
// Try mapping all children too
struct wlr_subsurface *child;
@ -250,7 +249,7 @@ static void subsurface_unmap(struct wlr_subsurface *subsurface) {
}
subsurface->mapped = false;
wlr_signal_emit_safe(&subsurface->events.unmap, subsurface);
wl_signal_emit_mutable(&subsurface->events.unmap, subsurface);
// Unmap all children
struct wlr_subsurface *child;
@ -458,7 +457,7 @@ static void subcompositor_handle_display_destroy(
struct wl_listener *listener, void *data) {
struct wlr_subcompositor *subcompositor =
wl_container_of(listener, subcompositor, display_destroy);
wlr_signal_emit_safe(&subcompositor->events.destroy, NULL);
wl_signal_emit_mutable(&subcompositor->events.destroy, NULL);
wl_list_remove(&subcompositor->display_destroy.link);
wl_global_destroy(subcompositor->global);
free(subcompositor);

View file

@ -8,7 +8,6 @@
#include <wlr/types/wlr_text_input_v3.h>
#include <wlr/util/log.h>
#include "text-input-unstable-v3-protocol.h"
#include "util/signal.h"
static void text_input_clear_focused_surface(struct wlr_text_input_v3 *text_input) {
wl_list_remove(&text_input->surface_destroy.link);
@ -66,7 +65,7 @@ void wlr_text_input_v3_send_done(struct wlr_text_input_v3 *text_input) {
}
static void wlr_text_input_destroy(struct wlr_text_input_v3 *text_input) {
wlr_signal_emit_safe(&text_input->events.destroy, text_input);
wl_signal_emit_mutable(&text_input->events.destroy, text_input);
text_input_clear_focused_surface(text_input);
wl_list_remove(&text_input->seat_destroy.link);
// remove from manager::text_inputs
@ -188,12 +187,12 @@ static void text_input_commit(struct wl_client *client,
if (!old_enabled && text_input->current_enabled) {
text_input->active_features = text_input->current.features;
wlr_signal_emit_safe(&text_input->events.enable, text_input);
wl_signal_emit_mutable(&text_input->events.enable, text_input);
} else if (old_enabled && !text_input->current_enabled) {
text_input->active_features = 0;
wlr_signal_emit_safe(&text_input->events.disable, text_input);
wl_signal_emit_mutable(&text_input->events.disable, text_input);
} else { // including never enabled
wlr_signal_emit_safe(&text_input->events.commit, text_input);
wl_signal_emit_mutable(&text_input->events.commit, text_input);
}
}
@ -280,7 +279,7 @@ static void text_input_manager_get_text_input(struct wl_client *client,
text_input_manager_from_resource(resource);
wl_list_insert(&manager->text_inputs, &text_input->link);
wlr_signal_emit_safe(&manager->events.text_input, text_input);
wl_signal_emit_mutable(&manager->events.text_input, text_input);
}
static const struct zwp_text_input_manager_v3_interface
@ -307,7 +306,7 @@ static void text_input_manager_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_text_input_manager_v3 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -3,7 +3,6 @@
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_viewporter.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "viewporter-protocol.h"
#define VIEWPORTER_VERSION 1
@ -211,7 +210,7 @@ static void viewporter_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_viewporter *viewporter =
wl_container_of(listener, viewporter, display_destroy);
wlr_signal_emit_safe(&viewporter->events.destroy, NULL);
wl_signal_emit_mutable(&viewporter->events.destroy, NULL);
wl_global_destroy(viewporter->global);
free(viewporter);
}

View file

@ -8,7 +8,6 @@
#include <wlr/types/wlr_virtual_keyboard_v1.h>
#include <wlr/util/log.h>
#include <xkbcommon/xkbcommon.h>
#include "util/signal.h"
#include "virtual-keyboard-unstable-v1-protocol.h"
static const struct wlr_keyboard_impl keyboard_impl = {
@ -176,7 +175,7 @@ static void virtual_keyboard_manager_create_virtual_keyboard(
wl_list_insert(&manager->virtual_keyboards, &virtual_keyboard->link);
wlr_signal_emit_safe(&manager->events.new_virtual_keyboard,
wl_signal_emit_mutable(&manager->events.new_virtual_keyboard,
virtual_keyboard);
}
@ -201,7 +200,7 @@ static void virtual_keyboard_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_virtual_keyboard_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -5,7 +5,6 @@
#include <wlr/types/wlr_virtual_pointer_v1.h>
#include <wlr/types/wlr_pointer.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "wlr-virtual-pointer-unstable-v1-protocol.h"
static const struct wlr_pointer_impl pointer_impl = {
@ -37,7 +36,7 @@ static void virtual_pointer_motion(struct wl_client *client,
.unaccel_dx = wl_fixed_to_double(dx),
.unaccel_dy = wl_fixed_to_double(dy),
};
wlr_signal_emit_safe(&pointer->pointer.events.motion, &event);
wl_signal_emit_mutable(&pointer->pointer.events.motion, &event);
}
static void virtual_pointer_motion_absolute(struct wl_client *client,
@ -57,7 +56,7 @@ static void virtual_pointer_motion_absolute(struct wl_client *client,
.x = (double)x / x_extent,
.y = (double)y / y_extent,
};
wlr_signal_emit_safe(&pointer->pointer.events.motion_absolute, &event);
wl_signal_emit_mutable(&pointer->pointer.events.motion_absolute, &event);
}
static void virtual_pointer_button(struct wl_client *client,
@ -74,7 +73,7 @@ static void virtual_pointer_button(struct wl_client *client,
.button = button,
.state = state ? WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED
};
wlr_signal_emit_safe(&pointer->pointer.events.button, &event);
wl_signal_emit_mutable(&pointer->pointer.events.button, &event);
}
static void virtual_pointer_axis(struct wl_client *client,
@ -112,14 +111,14 @@ static void virtual_pointer_frame(struct wl_client *client,
++i) {
if (pointer->axis_valid[i]) {
/* Deliver pending axis event */
wlr_signal_emit_safe(&pointer->pointer.events.axis,
wl_signal_emit_mutable(&pointer->pointer.events.axis,
&pointer->axis_event[i]);
memset(&pointer->axis_event[i], 0, sizeof(pointer->axis_event[i]));
pointer->axis_valid[i] = false;
}
}
wlr_signal_emit_safe(&pointer->pointer.events.frame, &pointer->pointer);
wl_signal_emit_mutable(&pointer->pointer.events.frame, &pointer->pointer);
}
static void virtual_pointer_axis_source(struct wl_client *client,
@ -270,7 +269,7 @@ static void virtual_pointer_manager_create_virtual_pointer_with_output(
virtual_pointer->resource = pointer_resource;
wl_list_insert(&manager->virtual_pointers, &virtual_pointer->link);
wlr_signal_emit_safe(&manager->events.new_virtual_pointer, &event);
wl_signal_emit_mutable(&manager->events.new_virtual_pointer, &event);
}
static void virtual_pointer_manager_create_virtual_pointer(
@ -308,7 +307,7 @@ static void virtual_pointer_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_virtual_pointer_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
struct wlr_virtual_pointer_v1 *pointer, *pointer_tmp;

View file

@ -6,7 +6,6 @@
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_xdg_activation_v1.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "util/token.h"
#include "xdg-activation-v1-protocol.h"
@ -33,7 +32,7 @@ void wlr_xdg_activation_token_v1_destroy(
wl_event_source_remove(token->timeout);
}
wlr_signal_emit_safe(&token->events.destroy, NULL);
wl_signal_emit_mutable(&token->events.destroy, NULL);
wl_list_remove(&token->link);
wl_list_remove(&token->seat_destroy.link);
@ -312,7 +311,7 @@ static void activation_handle_activate(struct wl_client *client,
.token = token,
.surface = surface,
};
wlr_signal_emit_safe(&activation->events.request_activate, &event);
wl_signal_emit_mutable(&activation->events.request_activate, &event);
wlr_xdg_activation_token_v1_destroy(token);
}
@ -339,7 +338,7 @@ static void activation_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_xdg_activation_v1 *activation =
wl_container_of(listener, activation, display_destroy);
wlr_signal_emit_safe(&activation->events.destroy, NULL);
wl_signal_emit_mutable(&activation->events.destroy, NULL);
struct wlr_xdg_activation_token_v1 *token, *token_tmp;
wl_list_for_each_safe(token, token_tmp, &activation->tokens, link) {

View file

@ -3,7 +3,6 @@
#include <stdlib.h>
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "xdg-decoration-unstable-v1-protocol.h"
#define DECORATION_MANAGER_VERSION 1
@ -31,7 +30,7 @@ static void toplevel_decoration_handle_set_mode(struct wl_client *client,
decoration->requested_mode =
(enum wlr_xdg_toplevel_decoration_v1_mode)mode;
wlr_signal_emit_safe(&decoration->events.request_mode, decoration);
wl_signal_emit_mutable(&decoration->events.request_mode, decoration);
}
static void toplevel_decoration_handle_unset_mode(struct wl_client *client,
@ -40,7 +39,7 @@ static void toplevel_decoration_handle_unset_mode(struct wl_client *client,
toplevel_decoration_from_resource(resource);
decoration->requested_mode = WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_NONE;
wlr_signal_emit_safe(&decoration->events.request_mode, decoration);
wl_signal_emit_mutable(&decoration->events.request_mode, decoration);
}
static const struct zxdg_toplevel_decoration_v1_interface
@ -62,7 +61,7 @@ static void toplevel_decoration_handle_resource_destroy(
struct wl_resource *resource) {
struct wlr_xdg_toplevel_decoration_v1 *decoration =
toplevel_decoration_from_resource(resource);
wlr_signal_emit_safe(&decoration->events.destroy, decoration);
wl_signal_emit_mutable(&decoration->events.destroy, decoration);
wl_list_remove(&decoration->surface_commit.link);
wl_list_remove(&decoration->surface_destroy.link);
wl_list_remove(&decoration->surface_configure.link);
@ -148,7 +147,7 @@ static void toplevel_decoration_handle_surface_commit(
if (decoration->surface->added && !decoration->added) {
decoration->added = true;
wlr_signal_emit_safe(&manager->events.new_toplevel_decoration,
wl_signal_emit_mutable(&manager->events.new_toplevel_decoration,
decoration);
}
}
@ -232,7 +231,7 @@ static void decoration_manager_handle_get_toplevel_decoration(
if (toplevel->base->added) {
decoration->added = true;
wlr_signal_emit_safe(&manager->events.new_toplevel_decoration,
wl_signal_emit_mutable(&manager->events.new_toplevel_decoration,
decoration);
}
}
@ -260,7 +259,7 @@ static void decoration_manager_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_xdg_decoration_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy);
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global);
free(manager);

View file

@ -1,5 +1,4 @@
#include <wlr/types/wlr_xdg_foreign_registry.h>
#include "util/signal.h"
#include "util/token.h"
#include <assert.h>
#include <stdlib.h>
@ -38,7 +37,7 @@ struct wlr_xdg_foreign_exported *wlr_xdg_foreign_registry_find_by_handle(
}
void wlr_xdg_foreign_exported_finish(struct wlr_xdg_foreign_exported *surface) {
wlr_signal_emit_safe(&surface->events.destroy, NULL);
wl_signal_emit_mutable(&surface->events.destroy, NULL);
surface->registry = NULL;
wl_list_remove(&surface->link);
wl_list_init(&surface->link);
@ -49,7 +48,7 @@ static void foreign_registry_handle_display_destroy(struct wl_listener *listener
struct wlr_xdg_foreign_registry *registry =
wl_container_of(listener, registry, display_destroy);
wlr_signal_emit_safe(&registry->events.destroy, NULL);
wl_signal_emit_mutable(&registry->events.destroy, NULL);
// Implementations are supposed to remove all surfaces
assert(wl_list_empty(&registry->exported_surfaces));

View file

@ -6,7 +6,6 @@
#include <wlr/types/wlr_xdg_foreign_v1.h>
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "xdg-foreign-unstable-v1-protocol.h"
#define FOREIGN_V1_VERSION 1
@ -361,7 +360,7 @@ static void xdg_foreign_destroy(struct wlr_xdg_foreign_v1 *foreign) {
return;
}
wlr_signal_emit_safe(&foreign->events.destroy, NULL);
wl_signal_emit_mutable(&foreign->events.destroy, NULL);
wl_list_remove(&foreign->foreign_registry_destroy.link);
wl_list_remove(&foreign->display_destroy.link);

View file

@ -6,7 +6,6 @@
#include <wlr/types/wlr_xdg_foreign_v2.h>
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h>
#include "util/signal.h"
#include "xdg-foreign-unstable-v2-protocol.h"
#define FOREIGN_V2_VERSION 1
@ -367,7 +366,7 @@ static void xdg_foreign_destroy(struct wlr_xdg_foreign_v2 *foreign) {
return;
}
wlr_signal_emit_safe(&foreign->events.destroy, NULL);
wl_signal_emit_mutable(&foreign->events.destroy, NULL);
wl_list_remove(&foreign->foreign_registry_destroy.link);
wl_list_remove(&foreign->display_destroy.link);

View file

@ -6,7 +6,6 @@
#include <wlr/types/wlr_xdg_output_v1.h>
#include <wlr/util/log.h>
#include "xdg-output-unstable-v1-protocol.h"
#include "util/signal.h"
#define OUTPUT_MANAGER_VERSION 3
#define OUTPUT_DONE_DEPRECATED_SINCE_VERSION 3
@ -231,7 +230,7 @@ static void manager_destroy(struct wlr_xdg_output_manager_v1 *manager) {
wl_list_for_each_safe(output, tmp, &manager->outputs, link) {
output_destroy(output);
}
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_signal_emit_mutable(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_list_remove(&manager->layout_add.link);
wl_list_remove(&manager->layout_change.link);

View file

@ -2,7 +2,6 @@
#include <stdlib.h>
#include <string.h>
#include "types/wlr_xdg_shell.h"
#include "util/signal.h"
void handle_xdg_popup_ack_configure(
struct wlr_xdg_popup *popup,
@ -325,7 +324,7 @@ static void xdg_popup_handle_reposition(
wlr_xdg_surface_schedule_configure(popup->base);
wlr_signal_emit_safe(&popup->events.reposition, NULL);
wl_signal_emit_mutable(&popup->events.reposition, NULL);
}
static void xdg_popup_handle_destroy(struct wl_client *client,
@ -419,7 +418,7 @@ void create_xdg_popup(struct wlr_xdg_surface *surface,
if (parent) {
surface->popup->parent = parent->surface;
wl_list_insert(&parent->popups, &surface->popup->link);
wlr_signal_emit_safe(&parent->events.new_popup, surface->popup);
wl_signal_emit_mutable(&parent->events.new_popup, surface->popup);
} else {
wl_list_init(&surface->popup->link);
}

View file

@ -1,7 +1,6 @@
#include <assert.h>
#include <stdlib.h>
#include "types/wlr_xdg_shell.h"
#include "util/signal.h"
#define WM_BASE_VERSION 5
@ -84,7 +83,7 @@ static int xdg_client_ping_timeout(void *user_data) {
struct wlr_xdg_surface *surface;
wl_list_for_each(surface, &client->surfaces, link) {
wlr_signal_emit_safe(&surface->events.ping_timeout, NULL);
wl_signal_emit_mutable(&surface->events.ping_timeout, NULL);
}
client->ping_serial = 0;
@ -131,7 +130,7 @@ static void xdg_shell_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_xdg_shell *xdg_shell =
wl_container_of(listener, xdg_shell, display_destroy);
wlr_signal_emit_safe(&xdg_shell->events.destroy, xdg_shell);
wl_signal_emit_mutable(&xdg_shell->events.destroy, xdg_shell);
wl_list_remove(&xdg_shell->display_destroy.link);
wl_global_destroy(xdg_shell->global);
free(xdg_shell);

View file

@ -4,7 +4,6 @@
#include <wlr/util/box.h>
#include <wlr/util/log.h>
#include "types/wlr_xdg_shell.h"
#include "util/signal.h"
bool wlr_surface_is_xdg_surface(struct wlr_surface *surface) {
return surface->role == &xdg_toplevel_surface_role ||
@ -34,7 +33,7 @@ void unmap_xdg_surface(struct wlr_xdg_surface *surface) {
// TODO: probably need to ungrab before this event
if (surface->mapped) {
surface->mapped = false;
wlr_signal_emit_safe(&surface->events.unmap, NULL);
wl_signal_emit_mutable(&surface->events.unmap, NULL);
}
struct wlr_xdg_popup *popup, *popup_tmp;
@ -98,7 +97,7 @@ static void xdg_surface_handle_ack_configure(struct wl_client *client,
if (configure->serial == serial) {
break;
}
wlr_signal_emit_safe(&surface->events.ack_configure, configure);
wl_signal_emit_mutable(&surface->events.ack_configure, configure);
xdg_surface_configure_destroy(configure);
}
@ -119,7 +118,7 @@ static void xdg_surface_handle_ack_configure(struct wl_client *client,
surface->configured = true;
surface->pending.configure_serial = serial;
wlr_signal_emit_safe(&surface->events.ack_configure, configure);
wl_signal_emit_mutable(&surface->events.ack_configure, configure);
xdg_surface_configure_destroy(configure);
}
@ -153,7 +152,7 @@ static void surface_send_configure(void *user_data) {
break;
}
wlr_signal_emit_safe(&surface->events.configure, configure);
wl_signal_emit_mutable(&surface->events.configure, configure);
xdg_surface_send_configure(surface->resource, configure->serial);
}
@ -306,13 +305,13 @@ void xdg_surface_role_commit(struct wlr_surface *wlr_surface) {
if (!surface->added) {
surface->added = true;
wlr_signal_emit_safe(&surface->client->shell->events.new_surface,
wl_signal_emit_mutable(&surface->client->shell->events.new_surface,
surface);
}
if (surface->configured && wlr_surface_has_buffer(surface->surface) &&
!surface->mapped) {
surface->mapped = true;
wlr_signal_emit_safe(&surface->events.map, NULL);
wl_signal_emit_mutable(&surface->events.map, NULL);
}
}
@ -405,7 +404,7 @@ void reset_xdg_surface(struct wlr_xdg_surface *surface) {
}
if (surface->added) {
wlr_signal_emit_safe(&surface->events.destroy, NULL);
wl_signal_emit_mutable(&surface->events.destroy, NULL);
surface->added = false;
}

View file

@ -5,7 +5,6 @@
#include <wlr/util/log.h>
#include <wlr/util/edges.h>
#include "types/wlr_xdg_shell.h"
#include "util/signal.h"
void handle_xdg_toplevel_ack_configure(
struct wlr_xdg_toplevel *toplevel,
@ -168,7 +167,7 @@ void wlr_xdg_toplevel_set_parent(struct wlr_xdg_toplevel *toplevel,
toplevel->parent = NULL;
}
wlr_signal_emit_safe(&toplevel->events.set_parent, NULL);
wl_signal_emit_mutable(&toplevel->events.set_parent, NULL);
}
static void xdg_toplevel_handle_set_parent(struct wl_client *client,
@ -198,7 +197,7 @@ static void xdg_toplevel_handle_set_title(struct wl_client *client,
free(toplevel->title);
toplevel->title = tmp;
wlr_signal_emit_safe(&toplevel->events.set_title, NULL);
wl_signal_emit_mutable(&toplevel->events.set_title, NULL);
}
static void xdg_toplevel_handle_set_app_id(struct wl_client *client,
@ -215,7 +214,7 @@ static void xdg_toplevel_handle_set_app_id(struct wl_client *client,
free(toplevel->app_id);
toplevel->app_id = tmp;
wlr_signal_emit_safe(&toplevel->events.set_app_id, NULL);
wl_signal_emit_mutable(&toplevel->events.set_app_id, NULL);
}
static void xdg_toplevel_handle_show_window_menu(struct wl_client *client,
@ -246,7 +245,7 @@ static void xdg_toplevel_handle_show_window_menu(struct wl_client *client,
.y = y,
};
wlr_signal_emit_safe(&toplevel->events.request_show_window_menu, &event);
wl_signal_emit_mutable(&toplevel->events.request_show_window_menu, &event);
}
static void xdg_toplevel_handle_move(struct wl_client *client,
@ -275,7 +274,7 @@ static void xdg_toplevel_handle_move(struct wl_client *client,
.serial = serial,
};
wlr_signal_emit_safe(&toplevel->events.request_move, &event);
wl_signal_emit_mutable(&toplevel->events.request_move, &event);
}
static void xdg_toplevel_handle_resize(struct wl_client *client,
@ -305,7 +304,7 @@ static void xdg_toplevel_handle_resize(struct wl_client *client,
.edges = edges,
};
wlr_signal_emit_safe(&toplevel->events.request_resize, &event);
wl_signal_emit_mutable(&toplevel->events.request_resize, &event);
}
static void xdg_toplevel_handle_set_max_size(struct wl_client *client,
@ -329,7 +328,7 @@ static void xdg_toplevel_handle_set_maximized(struct wl_client *client,
struct wlr_xdg_toplevel *toplevel =
wlr_xdg_toplevel_from_resource(resource);
toplevel->requested.maximized = true;
wlr_signal_emit_safe(&toplevel->events.request_maximize, NULL);
wl_signal_emit_mutable(&toplevel->events.request_maximize, NULL);
}
static void xdg_toplevel_handle_unset_maximized(struct wl_client *client,
@ -337,7 +336,7 @@ static void xdg_toplevel_handle_unset_maximized(struct wl_client *client,
struct wlr_xdg_toplevel *toplevel =
wlr_xdg_toplevel_from_resource(resource);
toplevel->requested.maximized = false;
wlr_signal_emit_safe(&toplevel->events.request_maximize, NULL);
wl_signal_emit_mutable(&toplevel->events.request_maximize, NULL);
}
static void handle_fullscreen_output_destroy(struct wl_listener *listener,
@ -376,7 +375,7 @@ static void xdg_toplevel_handle_set_fullscreen(struct wl_client *client,
store_fullscreen_requested(toplevel, true, output);
wlr_signal_emit_safe(&toplevel->events.request_fullscreen, NULL);
wl_signal_emit_mutable(&toplevel->events.request_fullscreen, NULL);
}
static void xdg_toplevel_handle_unset_fullscreen(struct wl_client *client,
@ -386,7 +385,7 @@ static void xdg_toplevel_handle_unset_fullscreen(struct wl_client *client,
store_fullscreen_requested(toplevel, false, NULL);
wlr_signal_emit_safe(&toplevel->events.request_fullscreen, NULL);
wl_signal_emit_mutable(&toplevel->events.request_fullscreen, NULL);
}
static void xdg_toplevel_handle_set_minimized(struct wl_client *client,
@ -394,7 +393,7 @@ static void xdg_toplevel_handle_set_minimized(struct wl_client *client,
struct wlr_xdg_toplevel *toplevel =
wlr_xdg_toplevel_from_resource(resource);
toplevel->requested.minimized = true;
wlr_signal_emit_safe(&toplevel->events.request_minimize, NULL);
wl_signal_emit_mutable(&toplevel->events.request_minimize, NULL);
}
static void xdg_toplevel_handle_destroy(struct wl_client *client,