mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
backend/wayland: give wlr_pointer ownership to wlr_wl_seat
All the code logic related to the pointer has been moved to its own file. The seat is responsible for the lifetime of its wlr_wl_pointer(s), and assigning them to the relevant wlr_wl_output. The wlr_wl_pointer becomes a simple helper to manager the wlr_pointer associated to the seat's wl_pointer and its lifetime.
This commit is contained in:
parent
f9b6aa3079
commit
be8527bd36
5 changed files with 569 additions and 520 deletions
|
|
@ -436,7 +436,9 @@ void update_wl_output_cursor(struct wlr_wl_output *output) {
|
|||
if (pointer) {
|
||||
assert(pointer->output == output);
|
||||
assert(output->enter_serial);
|
||||
wl_pointer_set_cursor(pointer->wl_pointer, output->enter_serial,
|
||||
|
||||
struct wlr_wl_seat *seat = pointer->seat;
|
||||
wl_pointer_set_cursor(seat->wl_pointer, output->enter_serial,
|
||||
output->cursor.surface, output->cursor.hotspot_x,
|
||||
output->cursor.hotspot_y);
|
||||
}
|
||||
|
|
@ -582,8 +584,8 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) {
|
|||
|
||||
struct wlr_wl_seat *seat;
|
||||
wl_list_for_each(seat, &backend->seats, link) {
|
||||
if (seat->pointer) {
|
||||
create_wl_pointer(seat, output);
|
||||
if (seat->wl_pointer) {
|
||||
create_pointer(seat, output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue