From ef4baea0e2f799c7bdd2e077dac4174fa31e85df Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Thu, 18 Aug 2022 07:16:16 -0400 Subject: Use wl_signal_emit_mutable --- backend/libinput/backend.c | 1 - backend/libinput/events.c | 13 ++++++------- backend/libinput/pointer.c | 37 ++++++++++++++++++------------------- backend/libinput/switch.c | 3 +-- backend/libinput/tablet_pad.c | 7 +++---- backend/libinput/tablet_tool.c | 11 +++++------ backend/libinput/touch.c | 11 +++++------ 7 files changed, 38 insertions(+), 45 deletions(-) (limited to 'backend/libinput') diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index f47121db..02c2f64b 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -6,7 +6,6 @@ #include #include #include "backend/libinput.h" -#include "util/signal.h" static struct wlr_libinput_backend *get_libinput_backend_from_backend( struct wlr_backend *wlr_backend) { diff --git a/backend/libinput/events.c b/backend/libinput/events.c index c5d9c67a..cbbf7537 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -11,7 +11,6 @@ #include #include #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); } diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index 841d3dfc..48f8ae12 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.c @@ -2,7 +2,6 @@ #include #include #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); } diff --git a/backend/libinput/switch.c b/backend/libinput/switch.c index 2e89ed59..e8c68bef 100644 --- a/backend/libinput/switch.c +++ b/backend/libinput/switch.c @@ -2,7 +2,6 @@ #include #include #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); } diff --git a/backend/libinput/tablet_pad.c b/backend/libinput/tablet_pad.c index 083711ef..078f7ca1 100644 --- a/backend/libinput/tablet_pad.c +++ b/backend/libinput/tablet_pad.c @@ -6,7 +6,6 @@ #include #include #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); } diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c index 31cd18b8..d049d16e 100644 --- a/backend/libinput/tablet_tool.c +++ b/backend/libinput/tablet_tool.c @@ -6,7 +6,6 @@ #include #include #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); } diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c index 1475a03e..3316754e 100644 --- a/backend/libinput/touch.c +++ b/backend/libinput/touch.c @@ -2,7 +2,6 @@ #include #include #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); } -- cgit v1.2.3