relative_pointer: send frame event to pointer for Xwayland

This commit is contained in:
random human 2018-10-01 21:49:26 +05:30 committed by Alex Maese
parent 6fa1777f94
commit fb44ce9fa8
3 changed files with 12 additions and 7 deletions

View File

@ -69,7 +69,7 @@ struct wlr_relative_pointer_v1 {
struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_v1_create(struct wl_display *display); struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_v1_create(struct wl_display *display);
void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *relative_pointer_manager); void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *relative_pointer_manager);
void wlr_relative_pointer_v1_send_relative_motion(struct wl_resource *resource, void wlr_relative_pointer_v1_send_relative_motion(struct wlr_relative_pointer_v1 *relative_pointer,
uint64_t time, double dx, double dy, double dx_unaccel, double dy_unaccel); uint64_t time, double dx, double dy, double dx_unaccel, double dy_unaccel);
#endif #endif

View File

@ -315,8 +315,15 @@ void wlr_seat_pointer_notify_relative_motion(struct wlr_seat *wlr_seat,
struct wl_resource *resource; struct wl_resource *resource;
wl_resource_for_each(resource, &client->relative_pointers) { wl_resource_for_each(resource, &client->relative_pointers) {
wlr_relative_pointer_v1_send_relative_motion(resource, time, dx, dy, struct wlr_relative_pointer_v1 *relative_pointer =
dx_unaccel, dy_unaccel); wl_resource_get_user_data(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);
} }
} }

View File

@ -182,12 +182,10 @@ void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *rel
} }
void wlr_relative_pointer_v1_send_relative_motion(struct wl_resource *resource, void wlr_relative_pointer_v1_send_relative_motion(struct wlr_relative_pointer_v1 *relative_pointer,
uint64_t time, double dx, double dy, uint64_t time, double dx, double dy,
double dx_unaccel, double dy_unaccel) { double dx_unaccel, double dy_unaccel) {
assert(wl_resource_instance_of(resource, &zwp_relative_pointer_v1_interface, zwp_relative_pointer_v1_send_relative_motion(relative_pointer->resource,
&relative_pointer_v1_impl));
zwp_relative_pointer_v1_send_relative_motion(resource,
(uint32_t)(time >> 32), (uint32_t)time, (uint32_t)(time >> 32), (uint32_t)time,
wl_fixed_from_double(dx), wl_fixed_from_double(dy), wl_fixed_from_double(dx), wl_fixed_from_double(dy),
wl_fixed_from_double(dx_unaccel), wl_fixed_from_double(dy_unaccel)); wl_fixed_from_double(dx_unaccel), wl_fixed_from_double(dy_unaccel));