mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Use wl_signal_emit_mutable
This commit is contained in:
parent
013f121f45
commit
ef4baea0e2
91 changed files with 365 additions and 456 deletions
|
|
@ -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