mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-26 06:59:52 -05:00
relative_pointer: implementation and code fixes
In particular, modified public creator and destructor function names, added a display destroy listener, safely extract user data from resources, send correct time (in usecs) in rootston, etc.
This commit is contained in:
parent
42ffa413fb
commit
68137dca3f
7 changed files with 96 additions and 53 deletions
|
|
@ -79,7 +79,7 @@ static void seat_client_handle_resource_destroy(
|
|||
wl_resource_for_each_safe(resource, tmp, &client->pointers) {
|
||||
wl_resource_destroy(resource);
|
||||
}
|
||||
wl_resource_for_each_safe(resource, tmp, &client->relative_pointers) {
|
||||
wl_resource_for_each_safe(resource, tmp, &client->relative_pointers_v1) {
|
||||
wl_resource_destroy(resource);
|
||||
}
|
||||
wl_resource_for_each_safe(resource, tmp, &client->keyboards) {
|
||||
|
|
@ -134,7 +134,7 @@ static void seat_handle_bind(struct wl_client *client, void *_wlr_seat,
|
|||
seat_client->seat = wlr_seat;
|
||||
wl_list_init(&seat_client->resources);
|
||||
wl_list_init(&seat_client->pointers);
|
||||
wl_list_init(&seat_client->relative_pointers);
|
||||
wl_list_init(&seat_client->relative_pointers_v1);
|
||||
wl_list_init(&seat_client->keyboards);
|
||||
wl_list_init(&seat_client->touches);
|
||||
wl_list_init(&seat_client->data_devices);
|
||||
|
|
|
|||
|
|
@ -314,16 +314,16 @@ void wlr_seat_pointer_notify_relative_motion(struct wlr_seat *wlr_seat,
|
|||
}
|
||||
|
||||
struct wl_resource *resource;
|
||||
wl_resource_for_each(resource, &client->relative_pointers) {
|
||||
wl_resource_for_each(resource, &client->relative_pointers_v1) {
|
||||
struct wlr_relative_pointer_v1 *relative_pointer =
|
||||
wl_resource_get_user_data(resource);
|
||||
wlr_relative_pointer_v1_from_resource(resource);
|
||||
if (relative_pointer == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
wlr_relative_pointer_v1_send_relative_motion(relative_pointer, time,
|
||||
dx, dy, dx_unaccel, dy_unaccel);
|
||||
pointer_send_frame((struct wl_resource *) relative_pointer->pointer);
|
||||
pointer_send_frame(relative_pointer->pointer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue