mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-14 08:22:25 -04:00
pointer: store the output instead of its name
In cases where the value is actually valid, the input device lives just as long as the output, so it's easier to provide the output itself instead for making a compositor find it by the name.
This commit is contained in:
parent
b61d5922f1
commit
4cbc8385ce
4 changed files with 3 additions and 5 deletions
|
|
@ -454,7 +454,7 @@ void create_pointer(struct wlr_wl_seat *seat, struct wlr_wl_output *output) {
|
||||||
snprintf(name, sizeof(name), "wayland-pointer-%s", seat->name);
|
snprintf(name, sizeof(name), "wayland-pointer-%s", seat->name);
|
||||||
wlr_pointer_init(&pointer->wlr_pointer, &wl_pointer_impl, name);
|
wlr_pointer_init(&pointer->wlr_pointer, &wl_pointer_impl, name);
|
||||||
|
|
||||||
pointer->wlr_pointer.output_name = strdup(output->wlr_output.name);
|
pointer->wlr_pointer.output = &output->wlr_output;
|
||||||
|
|
||||||
pointer->seat = seat;
|
pointer->seat = seat;
|
||||||
pointer->output = output;
|
pointer->output = output;
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,7 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
|
||||||
wlr_output_update_enabled(wlr_output, true);
|
wlr_output_update_enabled(wlr_output, true);
|
||||||
|
|
||||||
wlr_pointer_init(&output->pointer, &x11_pointer_impl, "x11-pointer");
|
wlr_pointer_init(&output->pointer, &x11_pointer_impl, "x11-pointer");
|
||||||
output->pointer.output_name = strdup(wlr_output->name);
|
output->pointer.output = wlr_output;
|
||||||
|
|
||||||
wlr_touch_init(&output->touch, &x11_touch_impl, "x11-touch");
|
wlr_touch_init(&output->touch, &x11_touch_impl, "x11-touch");
|
||||||
output->touch.output_name = strdup(wlr_output->name);
|
output->touch.output_name = strdup(wlr_output->name);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ struct wlr_pointer {
|
||||||
|
|
||||||
const struct wlr_pointer_impl *impl;
|
const struct wlr_pointer_impl *impl;
|
||||||
|
|
||||||
char *output_name;
|
struct wlr_output *output;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct wl_signal motion; // struct wlr_pointer_motion_event
|
struct wl_signal motion; // struct wlr_pointer_motion_event
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,4 @@ void wlr_pointer_init(struct wlr_pointer *pointer,
|
||||||
|
|
||||||
void wlr_pointer_finish(struct wlr_pointer *pointer) {
|
void wlr_pointer_finish(struct wlr_pointer *pointer) {
|
||||||
wlr_input_device_finish(&pointer->base);
|
wlr_input_device_finish(&pointer->base);
|
||||||
|
|
||||||
free(pointer->output_name);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue