mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-14 08:22:25 -04:00
Merge branch 'input-device-output' into 'master'
Draft: pointer,touch: store the output instead of its name See merge request wlroots/wlroots!4167
This commit is contained in:
commit
2f49d01779
5 changed files with 6 additions and 5 deletions
|
|
@ -469,7 +469,7 @@ void create_pointer(struct wlr_wl_seat *seat, struct wlr_wl_output *output) {
|
|||
snprintf(name, sizeof(name), "wayland-pointer-%s", seat->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->output = output;
|
||||
|
|
|
|||
|
|
@ -669,7 +669,7 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
|
|||
wl_list_insert(&x11->outputs, &output->link);
|
||||
|
||||
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");
|
||||
output->touch.output_name = strdup(wlr_output->name);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ struct wlr_pointer {
|
|||
|
||||
const struct wlr_pointer_impl *impl;
|
||||
|
||||
char *output_name;
|
||||
struct wlr_output *output;
|
||||
|
||||
uint32_t buttons[WLR_POINTER_BUTTONS_CAP];
|
||||
size_t button_count;
|
||||
|
|
|
|||
|
|
@ -286,6 +286,9 @@ static void server_new_pointer(struct tinywl_server *server,
|
|||
* opportunity to do libinput configuration on the device to set
|
||||
* acceleration, etc. */
|
||||
wlr_cursor_attach_input_device(server->cursor, device);
|
||||
|
||||
struct wlr_pointer *wlr_pointer = wlr_pointer_from_input_device(device);
|
||||
wlr_cursor_map_input_to_output(server->cursor, device, wlr_pointer->output);
|
||||
}
|
||||
|
||||
static void server_new_input(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ void wlr_pointer_finish(struct wlr_pointer *pointer) {
|
|||
}
|
||||
|
||||
wlr_input_device_finish(&pointer->base);
|
||||
|
||||
free(pointer->output_name);
|
||||
}
|
||||
|
||||
void wlr_pointer_notify_button(struct wlr_pointer *pointer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue