input: Don't send wl_pointer.motion if position didn't change
Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
+8
-4
@@ -173,6 +173,8 @@ default_grab_pointer_motion(struct weston_pointer_grab *grab, uint32_t time,
|
|||||||
struct wl_list *resource_list;
|
struct wl_list *resource_list;
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
wl_fixed_t x, y;
|
wl_fixed_t x, y;
|
||||||
|
wl_fixed_t old_sx = pointer->sx;
|
||||||
|
wl_fixed_t old_sy = pointer->sy;
|
||||||
|
|
||||||
if (pointer->focus) {
|
if (pointer->focus) {
|
||||||
weston_pointer_motion_to_abs(pointer, event, &x, &y);
|
weston_pointer_motion_to_abs(pointer, event, &x, &y);
|
||||||
@@ -182,10 +184,12 @@ default_grab_pointer_motion(struct weston_pointer_grab *grab, uint32_t time,
|
|||||||
|
|
||||||
weston_pointer_move(pointer, event);
|
weston_pointer_move(pointer, event);
|
||||||
|
|
||||||
resource_list = &pointer->focus_resource_list;
|
if (old_sx != pointer->sx || old_sy != pointer->sy) {
|
||||||
wl_resource_for_each(resource, resource_list) {
|
resource_list = &pointer->focus_resource_list;
|
||||||
wl_pointer_send_motion(resource, time,
|
wl_resource_for_each(resource, resource_list) {
|
||||||
pointer->sx, pointer->sy);
|
wl_pointer_send_motion(resource, time,
|
||||||
|
pointer->sx, pointer->sy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user