mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
Use wl_signal_emit_mutable
This commit is contained in:
parent
013f121f45
commit
ef4baea0e2
91 changed files with 365 additions and 456 deletions
|
|
@ -19,7 +19,6 @@
|
|||
#include "backend/wayland.h"
|
||||
#include "render/drm_format_set.h"
|
||||
#include "render/pixel_format.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#include "drm-client-protocol.h"
|
||||
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include "render/pixel_format.h"
|
||||
#include "render/swapchain.h"
|
||||
#include "render/wlr_renderer.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
||||
#include "presentation-time-client-protocol.h"
|
||||
|
|
@ -579,7 +578,7 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) {
|
|||
wl_list_insert(&backend->outputs, &output->link);
|
||||
wlr_output_update_enabled(wlr_output, true);
|
||||
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_output, wlr_output);
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_output, wlr_output);
|
||||
|
||||
struct wlr_wl_seat *seat;
|
||||
wl_list_for_each(seat, &backend->seats, link) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/wayland.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#include "pointer-gestures-unstable-v1-client-protocol.h"
|
||||
#include "relative-pointer-unstable-v1-client-protocol.h"
|
||||
|
|
@ -94,7 +93,7 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
|||
.x = wl_fixed_to_double(sx) / wlr_output->width,
|
||||
.y = wl_fixed_to_double(sy) / wlr_output->height,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.motion_absolute, &event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.motion_absolute, &event);
|
||||
}
|
||||
|
||||
static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
|
||||
|
|
@ -111,7 +110,7 @@ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
|
|||
.state = state,
|
||||
.time_msec = time,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.button, &event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.button, &event);
|
||||
}
|
||||
|
||||
static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer,
|
||||
|
|
@ -130,7 +129,7 @@ static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer,
|
|||
.time_msec = time,
|
||||
.source = pointer->axis_source,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.axis, &event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.axis, &event);
|
||||
|
||||
pointer->axis_discrete = 0;
|
||||
}
|
||||
|
|
@ -142,7 +141,7 @@ static void pointer_handle_frame(void *data, struct wl_pointer *wl_pointer) {
|
|||
return;
|
||||
}
|
||||
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.frame,
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.frame,
|
||||
&pointer->wlr_pointer);
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +172,7 @@ static void pointer_handle_axis_stop(void *data, struct wl_pointer *wl_pointer,
|
|||
.time_msec = time,
|
||||
.source = pointer->axis_source,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.axis, &event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.axis, &event);
|
||||
}
|
||||
|
||||
static void pointer_handle_axis_discrete(void *data,
|
||||
|
|
@ -228,7 +227,7 @@ static void gesture_swipe_begin(void *data,
|
|||
.time_msec = time,
|
||||
.fingers = fingers,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.swipe_begin, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.swipe_begin, &wlr_event);
|
||||
}
|
||||
|
||||
static void gesture_swipe_update(void *data,
|
||||
|
|
@ -247,7 +246,7 @@ static void gesture_swipe_update(void *data,
|
|||
.dx = wl_fixed_to_double(dx),
|
||||
.dy = wl_fixed_to_double(dy),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.swipe_update, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.swipe_update, &wlr_event);
|
||||
}
|
||||
|
||||
static void gesture_swipe_end(void *data,
|
||||
|
|
@ -264,7 +263,7 @@ static void gesture_swipe_end(void *data,
|
|||
.time_msec = time,
|
||||
.cancelled = cancelled,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.swipe_end, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.swipe_end, &wlr_event);
|
||||
}
|
||||
|
||||
static const struct zwp_pointer_gesture_swipe_v1_listener gesture_swipe_impl = {
|
||||
|
|
@ -291,7 +290,7 @@ static void gesture_pinch_begin(void *data,
|
|||
.fingers = pointer->fingers,
|
||||
};
|
||||
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.pinch_begin, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.pinch_begin, &wlr_event);
|
||||
}
|
||||
|
||||
static void gesture_pinch_update(void *data,
|
||||
|
|
@ -313,7 +312,7 @@ static void gesture_pinch_update(void *data,
|
|||
.scale = wl_fixed_to_double(scale),
|
||||
.rotation = wl_fixed_to_double(rotation),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.pinch_update, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.pinch_update, &wlr_event);
|
||||
}
|
||||
|
||||
static void gesture_pinch_end(void *data,
|
||||
|
|
@ -330,7 +329,7 @@ static void gesture_pinch_end(void *data,
|
|||
.time_msec = time,
|
||||
.cancelled = cancelled,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.pinch_end, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.pinch_end, &wlr_event);
|
||||
}
|
||||
|
||||
static const struct zwp_pointer_gesture_pinch_v1_listener gesture_pinch_impl = {
|
||||
|
|
@ -356,7 +355,7 @@ static void gesture_hold_begin(void *data,
|
|||
.time_msec = time,
|
||||
.fingers = fingers,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.hold_begin, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.hold_begin, &wlr_event);
|
||||
}
|
||||
|
||||
static void gesture_hold_end(void *data,
|
||||
|
|
@ -373,7 +372,7 @@ static void gesture_hold_end(void *data,
|
|||
.time_msec = time,
|
||||
.cancelled = cancelled,
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.hold_end, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.hold_end, &wlr_event);
|
||||
}
|
||||
|
||||
static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_impl = {
|
||||
|
|
@ -401,7 +400,7 @@ static void relative_pointer_handle_relative_motion(void *data,
|
|||
.unaccel_dx = wl_fixed_to_double(dx_unaccel),
|
||||
.unaccel_dy = wl_fixed_to_double(dy_unaccel),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->wlr_pointer.events.motion, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.motion, &wlr_event);
|
||||
}
|
||||
|
||||
static const struct zwp_relative_pointer_v1_listener relative_pointer_listener = {
|
||||
|
|
@ -463,7 +462,7 @@ void create_pointer(struct wlr_wl_seat *seat, struct wlr_wl_output *output) {
|
|||
wl_signal_add(&output->wlr_output.events.destroy, &pointer->output_destroy);
|
||||
pointer->output_destroy.notify = pointer_output_destroy;
|
||||
|
||||
wlr_signal_emit_safe(&seat->backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&seat->backend->backend.events.new_input,
|
||||
&pointer->wlr_pointer.base);
|
||||
|
||||
wl_list_insert(&seat->pointers, &pointer->link);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/wayland.h"
|
||||
#include "util/signal.h"
|
||||
#include "util/time.h"
|
||||
|
||||
static void keyboard_handle_keymap(void *data, struct wl_keyboard *wl_keyboard,
|
||||
|
|
@ -113,7 +112,7 @@ void init_seat_keyboard(struct wlr_wl_seat *seat) {
|
|||
wl_keyboard_add_listener(seat->wl_keyboard, &keyboard_listener,
|
||||
&seat->wlr_keyboard);
|
||||
|
||||
wlr_signal_emit_safe(&seat->backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&seat->backend->backend.events.new_input,
|
||||
&seat->wlr_keyboard.base);
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +147,7 @@ static void touch_handle_down(void *data, struct wl_touch *wl_touch,
|
|||
.touch_id = id,
|
||||
};
|
||||
touch_coordinates_to_absolute(seat, x, y, &event.x, &event.y);
|
||||
wlr_signal_emit_safe(&touch->events.down, &event);
|
||||
wl_signal_emit_mutable(&touch->events.down, &event);
|
||||
}
|
||||
|
||||
static void touch_handle_up(void *data, struct wl_touch *wl_touch,
|
||||
|
|
@ -161,7 +160,7 @@ static void touch_handle_up(void *data, struct wl_touch *wl_touch,
|
|||
.time_msec = time,
|
||||
.touch_id = id,
|
||||
};
|
||||
wlr_signal_emit_safe(&touch->events.up, &event);
|
||||
wl_signal_emit_mutable(&touch->events.up, &event);
|
||||
}
|
||||
|
||||
static void touch_handle_motion(void *data, struct wl_touch *wl_touch,
|
||||
|
|
@ -176,12 +175,12 @@ static void touch_handle_motion(void *data, struct wl_touch *wl_touch,
|
|||
};
|
||||
|
||||
touch_coordinates_to_absolute(seat, x, y, &event.x, &event.y);
|
||||
wlr_signal_emit_safe(&touch->events.motion, &event);
|
||||
wl_signal_emit_mutable(&touch->events.motion, &event);
|
||||
}
|
||||
|
||||
static void touch_handle_frame(void *data, struct wl_touch *wl_touch) {
|
||||
struct wlr_wl_seat *seat = data;
|
||||
wlr_signal_emit_safe(&seat->wlr_touch.events.frame, NULL);
|
||||
wl_signal_emit_mutable(&seat->wlr_touch.events.frame, NULL);
|
||||
}
|
||||
|
||||
static void touch_handle_cancel(void *data, struct wl_touch *wl_touch) {
|
||||
|
|
@ -228,7 +227,7 @@ void init_seat_touch(struct wlr_wl_seat *seat) {
|
|||
}
|
||||
|
||||
wl_touch_add_listener(seat->wl_touch, &touch_listener, seat);
|
||||
wlr_signal_emit_safe(&seat->backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&seat->backend->backend.events.new_input,
|
||||
&seat->wlr_touch.base);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/wayland.h"
|
||||
#include "util/signal.h"
|
||||
#include "util/time.h"
|
||||
|
||||
#include "tablet-unstable-v2-client-protocol.h"
|
||||
|
|
@ -108,11 +107,11 @@ static void handle_tablet_pad_ring_frame(void *data,
|
|||
};
|
||||
|
||||
if (ring->angle >= 0) {
|
||||
wlr_signal_emit_safe(&ring->group->pad->events.ring, &evt);
|
||||
wl_signal_emit_mutable(&ring->group->pad->events.ring, &evt);
|
||||
}
|
||||
if (ring->stopped) {
|
||||
evt.position = -1;
|
||||
wlr_signal_emit_safe(&ring->group->pad->events.ring, &evt);
|
||||
wl_signal_emit_mutable(&ring->group->pad->events.ring, &evt);
|
||||
}
|
||||
|
||||
ring->angle = -1;
|
||||
|
|
@ -161,11 +160,11 @@ static void handle_tablet_pad_strip_frame(void *data,
|
|||
};
|
||||
|
||||
if (strip->position >= 0) {
|
||||
wlr_signal_emit_safe(&strip->group->pad->events.strip, &evt);
|
||||
wl_signal_emit_mutable(&strip->group->pad->events.strip, &evt);
|
||||
}
|
||||
if (strip->stopped) {
|
||||
evt.position = -1;
|
||||
wlr_signal_emit_safe(&strip->group->pad->events.strip, &evt);
|
||||
wl_signal_emit_mutable(&strip->group->pad->events.strip, &evt);
|
||||
}
|
||||
|
||||
strip->position = -1;
|
||||
|
|
@ -345,13 +344,13 @@ static void handle_tablet_pad_button(void *data,
|
|||
.group = 0,
|
||||
};
|
||||
|
||||
wlr_signal_emit_safe(&seat->wlr_tablet_pad.events.button, &evt);
|
||||
wl_signal_emit_mutable(&seat->wlr_tablet_pad.events.button, &evt);
|
||||
}
|
||||
|
||||
static void handle_tablet_pad_done(void *data,
|
||||
struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) {
|
||||
struct wlr_wl_seat *seat = data;
|
||||
wlr_signal_emit_safe(&seat->backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&seat->backend->backend.events.new_input,
|
||||
&seat->wlr_tablet_pad.base);
|
||||
}
|
||||
|
||||
|
|
@ -362,7 +361,7 @@ static void handle_tablet_pad_enter(void *data,
|
|||
struct wlr_wl_seat *seat = data;
|
||||
assert(seat->zwp_tablet_v2 == tablet_p);
|
||||
|
||||
wlr_signal_emit_safe(&seat->wlr_tablet_pad.events.attach_tablet,
|
||||
wl_signal_emit_mutable(&seat->wlr_tablet_pad.events.attach_tablet,
|
||||
&seat->wlr_tablet_tool);
|
||||
}
|
||||
|
||||
|
|
@ -591,7 +590,7 @@ static void handle_tablet_tool_button(void *data,
|
|||
WLR_BUTTON_RELEASED : WLR_BUTTON_PRESSED,
|
||||
};
|
||||
|
||||
wlr_signal_emit_safe(&tablet->events.button, &evt);
|
||||
wl_signal_emit_mutable(&tablet->events.button, &evt);
|
||||
}
|
||||
|
||||
static void clear_tablet_tool_values(struct tablet_tool *tool) {
|
||||
|
|
@ -629,7 +628,7 @@ static void handle_tablet_tool_frame(void *data,
|
|||
.state = WLR_TABLET_TOOL_PROXIMITY_IN,
|
||||
};
|
||||
|
||||
wlr_signal_emit_safe(&tablet->events.proximity, &evt);
|
||||
wl_signal_emit_mutable(&tablet->events.proximity, &evt);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -686,7 +685,7 @@ static void handle_tablet_tool_frame(void *data,
|
|||
}
|
||||
|
||||
if (evt.updated_axes) {
|
||||
wlr_signal_emit_safe(&tablet->events.axis, &evt);
|
||||
wl_signal_emit_mutable(&tablet->events.axis, &evt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -705,7 +704,7 @@ static void handle_tablet_tool_frame(void *data,
|
|||
.state = WLR_TABLET_TOOL_TIP_DOWN,
|
||||
};
|
||||
|
||||
wlr_signal_emit_safe(&tablet->events.tip, &evt);
|
||||
wl_signal_emit_mutable(&tablet->events.tip, &evt);
|
||||
}
|
||||
|
||||
if (tool->is_up) {
|
||||
|
|
@ -718,7 +717,7 @@ static void handle_tablet_tool_frame(void *data,
|
|||
.state = WLR_TABLET_TOOL_TIP_UP,
|
||||
};
|
||||
|
||||
wlr_signal_emit_safe(&tablet->events.tip, &evt);
|
||||
wl_signal_emit_mutable(&tablet->events.tip, &evt);
|
||||
}
|
||||
|
||||
if (tool->is_out) {
|
||||
|
|
@ -731,7 +730,7 @@ static void handle_tablet_tool_frame(void *data,
|
|||
.state = WLR_TABLET_TOOL_PROXIMITY_OUT,
|
||||
};
|
||||
|
||||
wlr_signal_emit_safe(&tablet->events.proximity, &evt);
|
||||
wl_signal_emit_mutable(&tablet->events.proximity, &evt);
|
||||
}
|
||||
|
||||
clear_values:
|
||||
|
|
@ -829,7 +828,7 @@ static void handle_tablet_path(void *data, struct zwp_tablet_v2 *zwp_tablet_v2,
|
|||
static void handle_tablet_done(void *data, struct zwp_tablet_v2 *zwp_tablet_v2) {
|
||||
struct wlr_wl_seat *seat = data;
|
||||
|
||||
wlr_signal_emit_safe(&seat->backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&seat->backend->backend.events.new_input,
|
||||
&seat->wlr_tablet.base);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue