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
|
|
@ -17,7 +17,6 @@
|
|||
#include "backend/backend.h"
|
||||
#include "backend/multi.h"
|
||||
#include "render/allocator/allocator.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#if WLR_HAS_DRM_BACKEND
|
||||
#include <wlr/backend/drm.h>
|
||||
|
|
@ -44,7 +43,7 @@ void wlr_backend_init(struct wlr_backend *backend,
|
|||
}
|
||||
|
||||
void wlr_backend_finish(struct wlr_backend *backend) {
|
||||
wlr_signal_emit_safe(&backend->events.destroy, backend);
|
||||
wl_signal_emit_mutable(&backend->events.destroy, backend);
|
||||
}
|
||||
|
||||
bool wlr_backend_start(struct wlr_backend *backend) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#include <wlr/util/log.h>
|
||||
#include <xf86drm.h>
|
||||
#include "backend/drm/drm.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
struct wlr_drm_backend *get_drm_backend_from_backend(
|
||||
struct wlr_backend *wlr_backend) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
#include "render/drm_format_set.h"
|
||||
#include "render/swapchain.h"
|
||||
#include "render/wlr_renderer.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
// Output state which needs a KMS commit to be applied
|
||||
static const uint32_t COMMIT_OUTPUT_STATE =
|
||||
|
|
@ -1411,7 +1410,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
|
|||
struct wlr_drm_connector *conn = new_outputs[i];
|
||||
|
||||
wlr_drm_conn_log(conn, WLR_INFO, "Requesting modeset");
|
||||
wlr_signal_emit_safe(&drm->backend.events.new_output,
|
||||
wl_signal_emit_mutable(&drm->backend.events.new_output,
|
||||
&conn->output);
|
||||
}
|
||||
}
|
||||
|
|
@ -1664,7 +1663,7 @@ void wlr_drm_lease_terminate(struct wlr_drm_lease *lease) {
|
|||
void drm_lease_destroy(struct wlr_drm_lease *lease) {
|
||||
struct wlr_drm_backend *drm = lease->backend;
|
||||
|
||||
wlr_signal_emit_safe(&lease->events.destroy, NULL);
|
||||
wl_signal_emit_mutable(&lease->events.destroy, NULL);
|
||||
|
||||
struct wlr_drm_connector *conn;
|
||||
wl_list_for_each(conn, &drm->outputs, link) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "backend/headless.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
struct wlr_headless_backend *headless_backend_from_backend(
|
||||
struct wlr_backend *wlr_backend) {
|
||||
|
|
@ -20,7 +19,7 @@ static bool backend_start(struct wlr_backend *wlr_backend) {
|
|||
wl_list_for_each(output, &backend->outputs, link) {
|
||||
wl_event_source_timer_update(output->frame_timer, output->frame_delay);
|
||||
wlr_output_update_enabled(&output->wlr_output, true);
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_output,
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_output,
|
||||
&output->wlr_output);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "backend/headless.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
static const uint32_t SUPPORTED_OUTPUT_STATE =
|
||||
WLR_OUTPUT_STATE_BACKEND_OPTIONAL |
|
||||
|
|
@ -134,7 +133,7 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
|
|||
if (backend->started) {
|
||||
wl_event_source_timer_update(output->frame_timer, output->frame_delay);
|
||||
wlr_output_update_enabled(wlr_output, true);
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_output, wlr_output);
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_output, wlr_output);
|
||||
}
|
||||
|
||||
return wlr_output;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include <wlr/backend/session.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "backend/libinput.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
static struct wlr_libinput_backend *get_libinput_backend_from_backend(
|
||||
struct wlr_backend *wlr_backend) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
#include <wlr/interfaces/wlr_switch.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "backend/libinput.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
void destroy_libinput_input_device(struct wlr_libinput_input_device *dev) {
|
||||
if (dev->keyboard.impl) {
|
||||
|
|
@ -87,7 +86,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
|
|||
libinput_dev, LIBINPUT_DEVICE_CAP_KEYBOARD)) {
|
||||
init_device_keyboard(dev);
|
||||
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_input,
|
||||
&dev->keyboard.base);
|
||||
}
|
||||
|
||||
|
|
@ -95,35 +94,35 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
|
|||
libinput_dev, LIBINPUT_DEVICE_CAP_POINTER)) {
|
||||
init_device_pointer(dev);
|
||||
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_input,
|
||||
&dev->pointer.base);
|
||||
}
|
||||
|
||||
if (libinput_device_has_capability(
|
||||
libinput_dev, LIBINPUT_DEVICE_CAP_SWITCH)) {
|
||||
init_device_switch(dev);
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_input,
|
||||
&dev->switch_device.base);
|
||||
}
|
||||
|
||||
if (libinput_device_has_capability(
|
||||
libinput_dev, LIBINPUT_DEVICE_CAP_TOUCH)) {
|
||||
init_device_touch(dev);
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_input,
|
||||
&dev->touch.base);
|
||||
}
|
||||
|
||||
if (libinput_device_has_capability(libinput_dev,
|
||||
LIBINPUT_DEVICE_CAP_TABLET_TOOL)) {
|
||||
init_device_tablet(dev);
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_input,
|
||||
&dev->tablet.base);
|
||||
}
|
||||
|
||||
if (libinput_device_has_capability(
|
||||
libinput_dev, LIBINPUT_DEVICE_CAP_TABLET_PAD)) {
|
||||
init_device_tablet_pad(dev);
|
||||
wlr_signal_emit_safe(&backend->backend.events.new_input,
|
||||
wl_signal_emit_mutable(&backend->backend.events.new_input,
|
||||
&dev->tablet_pad.base);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include <libinput.h>
|
||||
#include <wlr/interfaces/wlr_pointer.h>
|
||||
#include "backend/libinput.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
const struct wlr_pointer_impl libinput_pointer_impl = {
|
||||
.name = "libinput-pointer",
|
||||
|
|
@ -37,8 +36,8 @@ void handle_pointer_motion(struct libinput_event *event,
|
|||
wlr_event.delta_y = libinput_event_pointer_get_dy(pevent);
|
||||
wlr_event.unaccel_dx = libinput_event_pointer_get_dx_unaccelerated(pevent);
|
||||
wlr_event.unaccel_dy = libinput_event_pointer_get_dy_unaccelerated(pevent);
|
||||
wlr_signal_emit_safe(&pointer->events.motion, &wlr_event);
|
||||
wlr_signal_emit_safe(&pointer->events.frame, pointer);
|
||||
wl_signal_emit_mutable(&pointer->events.motion, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.frame, pointer);
|
||||
}
|
||||
|
||||
void handle_pointer_motion_abs(struct libinput_event *event,
|
||||
|
|
@ -51,8 +50,8 @@ void handle_pointer_motion_abs(struct libinput_event *event,
|
|||
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
||||
wlr_event.x = libinput_event_pointer_get_absolute_x_transformed(pevent, 1);
|
||||
wlr_event.y = libinput_event_pointer_get_absolute_y_transformed(pevent, 1);
|
||||
wlr_signal_emit_safe(&pointer->events.motion_absolute, &wlr_event);
|
||||
wlr_signal_emit_safe(&pointer->events.frame, pointer);
|
||||
wl_signal_emit_mutable(&pointer->events.motion_absolute, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.frame, pointer);
|
||||
}
|
||||
|
||||
void handle_pointer_button(struct libinput_event *event,
|
||||
|
|
@ -72,8 +71,8 @@ void handle_pointer_button(struct libinput_event *event,
|
|||
wlr_event.state = WLR_BUTTON_RELEASED;
|
||||
break;
|
||||
}
|
||||
wlr_signal_emit_safe(&pointer->events.button, &wlr_event);
|
||||
wlr_signal_emit_safe(&pointer->events.frame, pointer);
|
||||
wl_signal_emit_mutable(&pointer->events.button, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.frame, pointer);
|
||||
}
|
||||
|
||||
void handle_pointer_axis(struct libinput_event *event,
|
||||
|
|
@ -120,9 +119,9 @@ void handle_pointer_axis(struct libinput_event *event,
|
|||
wlr_event.delta_discrete =
|
||||
libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]);
|
||||
wlr_event.delta_discrete *= WLR_POINTER_AXIS_DISCRETE_STEP;
|
||||
wlr_signal_emit_safe(&pointer->events.axis, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.axis, &wlr_event);
|
||||
}
|
||||
wlr_signal_emit_safe(&pointer->events.frame, pointer);
|
||||
wl_signal_emit_mutable(&pointer->events.frame, pointer);
|
||||
}
|
||||
|
||||
#if LIBINPUT_HAS_SCROLL_VALUE120
|
||||
|
|
@ -158,9 +157,9 @@ void handle_pointer_axis_value120(struct libinput_event *event,
|
|||
wlr_event.delta_discrete =
|
||||
libinput_event_pointer_get_scroll_value_v120(pevent, axes[i]);
|
||||
}
|
||||
wlr_signal_emit_safe(&pointer->events.axis, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.axis, &wlr_event);
|
||||
}
|
||||
wlr_signal_emit_safe(&pointer->events.frame, pointer);
|
||||
wl_signal_emit_mutable(&pointer->events.frame, pointer);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -174,7 +173,7 @@ void handle_pointer_swipe_begin(struct libinput_event *event,
|
|||
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
||||
.fingers = libinput_event_gesture_get_finger_count(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.swipe_begin, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.swipe_begin, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_pointer_swipe_update(struct libinput_event *event,
|
||||
|
|
@ -189,7 +188,7 @@ void handle_pointer_swipe_update(struct libinput_event *event,
|
|||
.dx = libinput_event_gesture_get_dx(gevent),
|
||||
.dy = libinput_event_gesture_get_dy(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.swipe_update, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.swipe_update, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_pointer_swipe_end(struct libinput_event *event,
|
||||
|
|
@ -202,7 +201,7 @@ void handle_pointer_swipe_end(struct libinput_event *event,
|
|||
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
||||
.cancelled = libinput_event_gesture_get_cancelled(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.swipe_end, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.swipe_end, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_pointer_pinch_begin(struct libinput_event *event,
|
||||
|
|
@ -215,7 +214,7 @@ void handle_pointer_pinch_begin(struct libinput_event *event,
|
|||
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
||||
.fingers = libinput_event_gesture_get_finger_count(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.pinch_begin, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.pinch_begin, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_pointer_pinch_update(struct libinput_event *event,
|
||||
|
|
@ -232,7 +231,7 @@ void handle_pointer_pinch_update(struct libinput_event *event,
|
|||
.scale = libinput_event_gesture_get_scale(gevent),
|
||||
.rotation = libinput_event_gesture_get_angle_delta(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.pinch_update, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.pinch_update, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_pointer_pinch_end(struct libinput_event *event,
|
||||
|
|
@ -245,7 +244,7 @@ void handle_pointer_pinch_end(struct libinput_event *event,
|
|||
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
||||
.cancelled = libinput_event_gesture_get_cancelled(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.pinch_end, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.pinch_end, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_pointer_hold_begin(struct libinput_event *event,
|
||||
|
|
@ -258,7 +257,7 @@ void handle_pointer_hold_begin(struct libinput_event *event,
|
|||
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
||||
.fingers = libinput_event_gesture_get_finger_count(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.hold_begin, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.hold_begin, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_pointer_hold_end(struct libinput_event *event,
|
||||
|
|
@ -271,5 +270,5 @@ void handle_pointer_hold_end(struct libinput_event *event,
|
|||
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
||||
.cancelled = libinput_event_gesture_get_cancelled(gevent),
|
||||
};
|
||||
wlr_signal_emit_safe(&pointer->events.hold_end, &wlr_event);
|
||||
wl_signal_emit_mutable(&pointer->events.hold_end, &wlr_event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include <libinput.h>
|
||||
#include <wlr/interfaces/wlr_switch.h>
|
||||
#include "backend/libinput.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
const struct wlr_switch_impl libinput_switch_impl = {
|
||||
.name = "libinput-switch",
|
||||
|
|
@ -48,5 +47,5 @@ void handle_switch_toggle(struct libinput_event *event,
|
|||
}
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_switch_get_time_usec(sevent));
|
||||
wlr_signal_emit_safe(&wlr_switch->events.toggle, &wlr_event);
|
||||
wl_signal_emit_mutable(&wlr_switch->events.toggle, &wlr_event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include <wlr/interfaces/wlr_tablet_pad.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "backend/libinput.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
const struct wlr_tablet_pad_impl libinput_tablet_pad_impl = {
|
||||
.name = "libinput-tablet-pad",
|
||||
|
|
@ -160,7 +159,7 @@ void handle_tablet_pad_button(struct libinput_event *event,
|
|||
wlr_event.state = WLR_BUTTON_RELEASED;
|
||||
break;
|
||||
}
|
||||
wlr_signal_emit_safe(&tablet_pad->events.button, &wlr_event);
|
||||
wl_signal_emit_mutable(&tablet_pad->events.button, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_tablet_pad_ring(struct libinput_event *event,
|
||||
|
|
@ -181,7 +180,7 @@ void handle_tablet_pad_ring(struct libinput_event *event,
|
|||
wlr_event.source = WLR_TABLET_PAD_RING_SOURCE_FINGER;
|
||||
break;
|
||||
}
|
||||
wlr_signal_emit_safe(&tablet_pad->events.ring, &wlr_event);
|
||||
wl_signal_emit_mutable(&tablet_pad->events.ring, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_tablet_pad_strip(struct libinput_event *event,
|
||||
|
|
@ -202,5 +201,5 @@ void handle_tablet_pad_strip(struct libinput_event *event,
|
|||
wlr_event.source = WLR_TABLET_PAD_STRIP_SOURCE_FINGER;
|
||||
break;
|
||||
}
|
||||
wlr_signal_emit_safe(&tablet_pad->events.strip, &wlr_event);
|
||||
wl_signal_emit_mutable(&tablet_pad->events.strip, &wlr_event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include <wlr/interfaces/wlr_tablet_tool.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "backend/libinput.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
struct tablet_tool {
|
||||
struct wlr_tablet_tool wlr_tool;
|
||||
|
|
@ -36,7 +35,7 @@ void init_device_tablet(struct wlr_libinput_input_device *dev) {
|
|||
}
|
||||
|
||||
static void tool_destroy(struct tablet_tool *tool) {
|
||||
wlr_signal_emit_safe(&tool->wlr_tool.events.destroy, &tool->wlr_tool);
|
||||
wl_signal_emit_mutable(&tool->wlr_tool.events.destroy, &tool->wlr_tool);
|
||||
libinput_tablet_tool_unref(tool->handle);
|
||||
libinput_tablet_tool_set_user_data(tool->handle, NULL);
|
||||
wl_list_remove(&tool->link);
|
||||
|
|
@ -173,7 +172,7 @@ void handle_tablet_tool_axis(struct libinput_event *event,
|
|||
wlr_event.updated_axes |= WLR_TABLET_TOOL_AXIS_WHEEL;
|
||||
wlr_event.wheel_delta = libinput_event_tablet_tool_get_wheel_delta(tevent);
|
||||
}
|
||||
wlr_signal_emit_safe(&wlr_tablet->events.axis, &wlr_event);
|
||||
wl_signal_emit_mutable(&wlr_tablet->events.axis, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_tablet_tool_proximity(struct libinput_event *event,
|
||||
|
|
@ -200,7 +199,7 @@ void handle_tablet_tool_proximity(struct libinput_event *event,
|
|||
wlr_event.state = WLR_TABLET_TOOL_PROXIMITY_IN;
|
||||
break;
|
||||
}
|
||||
wlr_signal_emit_safe(&wlr_tablet->events.proximity, &wlr_event);
|
||||
wl_signal_emit_mutable(&wlr_tablet->events.proximity, &wlr_event);
|
||||
|
||||
if (libinput_event_tablet_tool_get_proximity_state(tevent) ==
|
||||
LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN) {
|
||||
|
|
@ -242,7 +241,7 @@ void handle_tablet_tool_tip(struct libinput_event *event,
|
|||
wlr_event.state = WLR_TABLET_TOOL_TIP_DOWN;
|
||||
break;
|
||||
}
|
||||
wlr_signal_emit_safe(&wlr_tablet->events.tip, &wlr_event);
|
||||
wl_signal_emit_mutable(&wlr_tablet->events.tip, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_tablet_tool_button(struct libinput_event *event,
|
||||
|
|
@ -268,5 +267,5 @@ void handle_tablet_tool_button(struct libinput_event *event,
|
|||
wlr_event.state = WLR_BUTTON_PRESSED;
|
||||
break;
|
||||
}
|
||||
wlr_signal_emit_safe(&wlr_tablet->events.button, &wlr_event);
|
||||
wl_signal_emit_mutable(&wlr_tablet->events.button, &wlr_event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include <libinput.h>
|
||||
#include <wlr/interfaces/wlr_touch.h>
|
||||
#include "backend/libinput.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
const struct wlr_touch_impl libinput_touch_impl = {
|
||||
.name = "libinput-touch",
|
||||
|
|
@ -39,7 +38,7 @@ void handle_touch_down(struct libinput_event *event,
|
|||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
wlr_event.x = libinput_event_touch_get_x_transformed(tevent, 1);
|
||||
wlr_event.y = libinput_event_touch_get_y_transformed(tevent, 1);
|
||||
wlr_signal_emit_safe(&touch->events.down, &wlr_event);
|
||||
wl_signal_emit_mutable(&touch->events.down, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_touch_up(struct libinput_event *event,
|
||||
|
|
@ -51,7 +50,7 @@ void handle_touch_up(struct libinput_event *event,
|
|||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
wlr_signal_emit_safe(&touch->events.up, &wlr_event);
|
||||
wl_signal_emit_mutable(&touch->events.up, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_touch_motion(struct libinput_event *event,
|
||||
|
|
@ -65,7 +64,7 @@ void handle_touch_motion(struct libinput_event *event,
|
|||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
wlr_event.x = libinput_event_touch_get_x_transformed(tevent, 1);
|
||||
wlr_event.y = libinput_event_touch_get_y_transformed(tevent, 1);
|
||||
wlr_signal_emit_safe(&touch->events.motion, &wlr_event);
|
||||
wl_signal_emit_mutable(&touch->events.motion, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_touch_cancel(struct libinput_event *event,
|
||||
|
|
@ -77,10 +76,10 @@ void handle_touch_cancel(struct libinput_event *event,
|
|||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
wlr_signal_emit_safe(&touch->events.cancel, &wlr_event);
|
||||
wl_signal_emit_mutable(&touch->events.cancel, &wlr_event);
|
||||
}
|
||||
|
||||
void handle_touch_frame(struct libinput_event *event,
|
||||
struct wlr_touch *touch) {
|
||||
wlr_signal_emit_safe(&touch->events.frame, NULL);
|
||||
wl_signal_emit_mutable(&touch->events.frame, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <wlr/util/log.h>
|
||||
#include "backend/backend.h"
|
||||
#include "backend/multi.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
struct subbackend_state {
|
||||
struct wlr_backend *backend;
|
||||
|
|
@ -161,13 +160,13 @@ bool wlr_backend_is_multi(struct wlr_backend *b) {
|
|||
static void new_input_reemit(struct wl_listener *listener, void *data) {
|
||||
struct subbackend_state *state = wl_container_of(listener,
|
||||
state, new_input);
|
||||
wlr_signal_emit_safe(&state->container->events.new_input, data);
|
||||
wl_signal_emit_mutable(&state->container->events.new_input, data);
|
||||
}
|
||||
|
||||
static void new_output_reemit(struct wl_listener *listener, void *data) {
|
||||
struct subbackend_state *state = wl_container_of(listener,
|
||||
state, new_output);
|
||||
wlr_signal_emit_safe(&state->container->events.new_output, data);
|
||||
wl_signal_emit_mutable(&state->container->events.new_output, data);
|
||||
}
|
||||
|
||||
static void handle_subbackend_destroy(struct wl_listener *listener,
|
||||
|
|
@ -218,7 +217,7 @@ bool wlr_multi_backend_add(struct wlr_backend *_multi,
|
|||
wl_signal_add(&backend->events.new_output, &sub->new_output);
|
||||
sub->new_output.notify = new_output_reemit;
|
||||
|
||||
wlr_signal_emit_safe(&multi->events.backend_add, backend);
|
||||
wl_signal_emit_mutable(&multi->events.backend_add, backend);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -230,7 +229,7 @@ void wlr_multi_backend_remove(struct wlr_backend *_multi,
|
|||
multi_backend_get_subbackend(multi, backend);
|
||||
|
||||
if (sub) {
|
||||
wlr_signal_emit_safe(&multi->events.backend_remove, backend);
|
||||
wl_signal_emit_mutable(&multi->events.backend_remove, backend);
|
||||
subbackend_state_destroy(sub);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include "backend/session/session.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#include <libseat.h>
|
||||
|
||||
|
|
@ -26,13 +25,13 @@
|
|||
static void handle_enable_seat(struct libseat *seat, void *data) {
|
||||
struct wlr_session *session = data;
|
||||
session->active = true;
|
||||
wlr_signal_emit_safe(&session->events.active, NULL);
|
||||
wl_signal_emit_mutable(&session->events.active, NULL);
|
||||
}
|
||||
|
||||
static void handle_disable_seat(struct libseat *seat, void *data) {
|
||||
struct wlr_session *session = data;
|
||||
session->active = false;
|
||||
wlr_signal_emit_safe(&session->events.active, NULL);
|
||||
wl_signal_emit_mutable(&session->events.active, NULL);
|
||||
libseat_disable_seat(session->seat_handle);
|
||||
}
|
||||
|
||||
|
|
@ -198,7 +197,7 @@ static int handle_udev_event(int fd, uint32_t mask, void *data) {
|
|||
struct wlr_session_add_event event = {
|
||||
.path = devnode,
|
||||
};
|
||||
wlr_signal_emit_safe(&session->events.add_drm_card, &event);
|
||||
wl_signal_emit_mutable(&session->events.add_drm_card, &event);
|
||||
} else if (strcmp(action, "change") == 0 || strcmp(action, "remove") == 0) {
|
||||
dev_t devnum = udev_device_get_devnum(udev_dev);
|
||||
struct wlr_device *dev;
|
||||
|
|
@ -211,10 +210,10 @@ static int handle_udev_event(int fd, uint32_t mask, void *data) {
|
|||
wlr_log(WLR_DEBUG, "DRM device %s changed", sysname);
|
||||
struct wlr_device_change_event event = {0};
|
||||
read_udev_change_event(&event, udev_dev);
|
||||
wlr_signal_emit_safe(&dev->events.change, &event);
|
||||
wl_signal_emit_mutable(&dev->events.change, &event);
|
||||
} else if (strcmp(action, "remove") == 0) {
|
||||
wlr_log(WLR_DEBUG, "DRM device %s removed", sysname);
|
||||
wlr_signal_emit_safe(&dev->events.remove, NULL);
|
||||
wl_signal_emit_mutable(&dev->events.remove, NULL);
|
||||
} else {
|
||||
assert(0);
|
||||
}
|
||||
|
|
@ -298,7 +297,7 @@ void wlr_session_destroy(struct wlr_session *session) {
|
|||
return;
|
||||
}
|
||||
|
||||
wlr_signal_emit_safe(&session->events.destroy, session);
|
||||
wl_signal_emit_mutable(&session->events.destroy, session);
|
||||
wl_list_remove(&session->display_destroy.link);
|
||||
|
||||
wl_event_source_remove(session->udev_event);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "backend/x11.h"
|
||||
#include "render/drm_format_set.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
// See dri2_format_for_depth in mesa
|
||||
const struct wlr_x11_format formats[] = {
|
||||
|
|
@ -164,7 +163,7 @@ static bool backend_start(struct wlr_backend *backend) {
|
|||
|
||||
wlr_log(WLR_INFO, "Starting X11 backend");
|
||||
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_input, &x11->keyboard.base);
|
||||
wl_signal_emit_mutable(&x11->backend.events.new_input, &x11->keyboard.base);
|
||||
|
||||
for (size_t i = 0; i < x11->requested_outputs; ++i) {
|
||||
wlr_x11_output_create(&x11->backend);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/x11.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
static void send_key_event(struct wlr_x11_backend *x11, uint32_t key,
|
||||
enum wl_keyboard_key_state st, xcb_timestamp_t time) {
|
||||
|
|
@ -37,8 +36,8 @@ static void send_button_event(struct wlr_x11_output *output, uint32_t key,
|
|||
.button = key,
|
||||
.state = st,
|
||||
};
|
||||
wlr_signal_emit_safe(&output->pointer.events.button, &ev);
|
||||
wlr_signal_emit_safe(&output->pointer.events.frame, &output->pointer);
|
||||
wl_signal_emit_mutable(&output->pointer.events.button, &ev);
|
||||
wl_signal_emit_mutable(&output->pointer.events.frame, &output->pointer);
|
||||
}
|
||||
|
||||
static void send_axis_event(struct wlr_x11_output *output, int32_t delta,
|
||||
|
|
@ -52,8 +51,8 @@ static void send_axis_event(struct wlr_x11_output *output, int32_t delta,
|
|||
.delta = delta * 15,
|
||||
.delta_discrete = delta,
|
||||
};
|
||||
wlr_signal_emit_safe(&output->pointer.events.axis, &ev);
|
||||
wlr_signal_emit_safe(&output->pointer.events.frame, &output->pointer);
|
||||
wl_signal_emit_mutable(&output->pointer.events.axis, &ev);
|
||||
wl_signal_emit_mutable(&output->pointer.events.frame, &output->pointer);
|
||||
}
|
||||
|
||||
static void send_pointer_position_event(struct wlr_x11_output *output,
|
||||
|
|
@ -64,8 +63,8 @@ static void send_pointer_position_event(struct wlr_x11_output *output,
|
|||
.x = (double)x / output->wlr_output.width,
|
||||
.y = (double)y / output->wlr_output.height,
|
||||
};
|
||||
wlr_signal_emit_safe(&output->pointer.events.motion_absolute, &ev);
|
||||
wlr_signal_emit_safe(&output->pointer.events.frame, &output->pointer);
|
||||
wl_signal_emit_mutable(&output->pointer.events.motion_absolute, &ev);
|
||||
wl_signal_emit_mutable(&output->pointer.events.frame, &output->pointer);
|
||||
}
|
||||
|
||||
static void send_touch_down_event(struct wlr_x11_output *output,
|
||||
|
|
@ -77,8 +76,8 @@ static void send_touch_down_event(struct wlr_x11_output *output,
|
|||
.y = (double)y / output->wlr_output.height,
|
||||
.touch_id = touch_id,
|
||||
};
|
||||
wlr_signal_emit_safe(&output->touch.events.down, &ev);
|
||||
wlr_signal_emit_safe(&output->touch.events.frame, NULL);
|
||||
wl_signal_emit_mutable(&output->touch.events.down, &ev);
|
||||
wl_signal_emit_mutable(&output->touch.events.frame, NULL);
|
||||
}
|
||||
|
||||
static void send_touch_motion_event(struct wlr_x11_output *output,
|
||||
|
|
@ -90,8 +89,8 @@ static void send_touch_motion_event(struct wlr_x11_output *output,
|
|||
.y = (double)y / output->wlr_output.height,
|
||||
.touch_id = touch_id,
|
||||
};
|
||||
wlr_signal_emit_safe(&output->touch.events.motion, &ev);
|
||||
wlr_signal_emit_safe(&output->touch.events.frame, NULL);
|
||||
wl_signal_emit_mutable(&output->touch.events.motion, &ev);
|
||||
wl_signal_emit_mutable(&output->touch.events.frame, NULL);
|
||||
}
|
||||
|
||||
static void send_touch_up_event(struct wlr_x11_output *output,
|
||||
|
|
@ -101,8 +100,8 @@ static void send_touch_up_event(struct wlr_x11_output *output,
|
|||
.time_msec = time,
|
||||
.touch_id = touch_id,
|
||||
};
|
||||
wlr_signal_emit_safe(&output->touch.events.up, &ev);
|
||||
wlr_signal_emit_safe(&output->touch.events.frame, NULL);
|
||||
wl_signal_emit_mutable(&output->touch.events.up, &ev);
|
||||
wl_signal_emit_mutable(&output->touch.events.frame, NULL);
|
||||
}
|
||||
|
||||
static struct wlr_x11_touchpoint *get_touchpoint_from_x11_touch_id(
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/x11.h"
|
||||
#include "util/signal.h"
|
||||
#include "util/time.h"
|
||||
|
||||
static const uint32_t SUPPORTED_OUTPUT_STATE =
|
||||
|
|
@ -590,9 +589,9 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
|
|||
output->touch.output_name = strdup(wlr_output->name);
|
||||
wl_list_init(&output->touchpoints);
|
||||
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_output, wlr_output);
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_input, &output->pointer.base);
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_input, &output->touch.base);
|
||||
wl_signal_emit_mutable(&x11->backend.events.new_output, wlr_output);
|
||||
wl_signal_emit_mutable(&x11->backend.events.new_input, &output->pointer.base);
|
||||
wl_signal_emit_mutable(&x11->backend.events.new_input, &output->touch.base);
|
||||
|
||||
// Start the rendering loop by requesting the compositor to render a frame
|
||||
wlr_output_schedule_frame(wlr_output);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue