[gtk+/multitouch: 115/129] tests: only handle gestures on testgestures after the last stroke is lifted
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multitouch: 115/129] tests: only handle gestures on testgestures after the last stroke is lifted
- Date: Sat, 18 Feb 2012 17:16:00 +0000 (UTC)
commit ca84ac7a6aa11ee70f4142dbb9ca40fe4e371caf
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Jan 12 02:52:23 2012 +0100
tests: only handle gestures on testgestures after the last stroke is lifted
tests/testgestures.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/tests/testgestures.c b/tests/testgestures.c
index 9ff6dcb..5da7149 100644
--- a/tests/testgestures.c
+++ b/tests/testgestures.c
@@ -172,6 +172,10 @@ append_event_coordinates (GdkEvent *event)
coords = g_hash_table_lookup (strokes,
GUINT_TO_POINTER (touch_id));
+
+ if (!coords)
+ return FALSE;
+
point.x = x;
point.y = y;
g_array_append_val (coords, point);
@@ -220,10 +224,13 @@ button_release_cb (GtkWidget *widget,
append_event_coordinates (event);
gtk_gestures_interpreter_feed_event (interpreter, event);
- if (gtk_gestures_interpreter_finish (interpreter, &gesture_id))
- shown_gesture = gesture_id;
+ if (gtk_gestures_interpreter_get_n_active_strokes (interpreter) == 0)
+ {
+ if (gtk_gestures_interpreter_finish (interpreter, &gesture_id))
+ shown_gesture = gesture_id;
- gtk_widget_queue_draw (widget);
+ gtk_widget_queue_draw (widget);
+ }
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]