summaryrefslogtreecommitdiff
path: root/ivi-input-controller
diff options
context:
space:
mode:
authorEmre Ucan <eucan@de.adit-jv.com>2015-05-20 09:05:38 +0200
committerNobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>2015-06-15 16:23:32 +0900
commit5e322375a29e2db88031ff96aebaaa9b39d649e1 (patch)
tree1dbcdb752169756d1174d8d84b288118dc8da0cd /ivi-input-controller
parent7c9d5b2daa1f21a8d4d84ed5c4660f481688a940 (diff)
downloadwayland-ivi-extension-5e322375a29e2db88031ff96aebaaa9b39d649e1.tar.gz
ivi-input-controller: return after a pointer motion event is sent.
Because only one surface can have pointer focus per seat. It is not needed to check all surfaces for pointer focus. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Diffstat (limited to 'ivi-input-controller')
-rw-r--r--ivi-input-controller/src/ivi-input-controller.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/ivi-input-controller/src/ivi-input-controller.c b/ivi-input-controller/src/ivi-input-controller.c
index 66d3ec7..ff5c63c 100644
--- a/ivi-input-controller/src/ivi-input-controller.c
+++ b/ivi-input-controller/src/ivi-input-controller.c
@@ -319,20 +319,24 @@ pointer_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
surf = interface->surface_get_weston_surface(surf_ctx->layout_surface);
view = wl_container_of(surf->views.next, view, surface_link);
- /* Do not send motion events for coordinates outside the surface */
- weston_view_from_global_fixed(view, x, y, &sx, &sy);
- if ((!pixman_region32_contains_point(&surf->input, wl_fixed_to_int(sx),
- wl_fixed_to_int(sy), NULL))
- && (grab->pointer->button_count == 0))
- continue;
-
- surface_client = wl_resource_get_client(surf->resource);
+ if (view == grab->pointer->focus) {
- wl_resource_for_each(resource, &grab->pointer->focus_resource_list) {
- if (wl_resource_get_client(resource) != surface_client)
+ /* Do not send motion events for coordinates outside the surface */
+ weston_view_from_global_fixed(view, x, y, &sx, &sy);
+ if ((!pixman_region32_contains_point(&surf->input, wl_fixed_to_int(sx),
+ wl_fixed_to_int(sy), NULL))
+ && (grab->pointer->button_count == 0))
continue;
- wl_pointer_send_motion(resource, time, sx, sy);
+ surface_client = wl_resource_get_client(surf->resource);
+
+ wl_resource_for_each(resource, &grab->pointer->focus_resource_list) {
+ if (wl_resource_get_client(resource) != surface_client)
+ continue;
+
+ wl_pointer_send_motion(resource, time, sx, sy);
+ }
+ return;
}
}
}