summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-12-05 18:47:05 +0000
committerKristian Høgsberg <krh@bitplanet.net>2012-12-11 23:47:12 -0500
commitf14a241f3554963e8bef82beae275301720ac47e (patch)
treee628ce83ec21b551b991c8fa5dc5a180c53e6d7e
parent15b3caf2ea61356b3bbe48b4caa8e6652f901f61 (diff)
downloadweston-f14a241f3554963e8bef82beae275301720ac47e.tar.gz
compositor: Avoid sending event for invalid point
Avoid sending a touch down event using uninitialised surface x/y co-ordinates. Instead present a log message about this unexpected case.
-rw-r--r--src/compositor.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 17a9203c..69dfd410 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1943,6 +1943,13 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
} else if (touch->focus) {
es = (struct weston_surface *) touch->focus;
weston_surface_from_global_fixed(es, x, y, &sx, &sy);
+ } else {
+ /* Unexpected condition: We have non-initial touch but
+ * there is no focused surface.
+ */
+ weston_log("touch event received with %d points down"
+ "but no surface focused\n", seat->num_tp);
+ return;
}
grab->interface->down(grab, time, touch_id, sx, sy);