summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2015-05-22 13:19:29 +0200
committerCarlos Garnacho <carlosg@gnome.org>2015-05-26 19:02:51 +0200
commita4962c033674ce358e6ae2adc16c97a00cca9971 (patch)
tree0e4414cee50c20a36295bf121fc071f1feb2d0d8
parent67bf902022bfc042b55db87016d3a1b7cfba977a (diff)
downloadclutter-a4962c033674ce358e6ae2adc16c97a00cca9971.tar.gz
swipe-action: Prepare for multifinger swipes
Its ::gesture-end implementation used to check the press/release coordinates for the first touchpoint. On multifinger swipes, we can receive this vfunc called due to other touch sequence going first, so we'd get 0/0 as the release coordinates for this still active sequence, resulting in bogus directions. Instead, check the last event coordinates, that will be always correct regardless of whether the touchpoint 0 finished yet or not. https://bugzilla.gnome.org/show_bug.cgi?id=749739
-rw-r--r--clutter/clutter-swipe-action.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/clutter/clutter-swipe-action.c b/clutter/clutter-swipe-action.c
index 452a5a020..38e183085 100644
--- a/clutter/clutter-swipe-action.c
+++ b/clutter/clutter-swipe-action.c
@@ -145,14 +145,17 @@ gesture_end (ClutterGestureAction *action,
gfloat release_x, release_y;
ClutterSwipeDirection direction = 0;
gboolean can_emit_swipe;
+ const ClutterEvent *last_event;
clutter_gesture_action_get_press_coords (action,
0,
&press_x, &press_y);
- clutter_gesture_action_get_release_coords (action,
- 0,
- &release_x, &release_y);
+ /* Check the last event instead of get_release_coords(), this
+ * might not be the sequence that finished on multi-finger swipes.
+ */
+ last_event = clutter_gesture_action_get_last_event (action, 0);
+ clutter_event_get_coords (last_event, &release_x, &release_y);
if (release_x - press_x > priv->distance_y)
direction |= CLUTTER_SWIPE_DIRECTION_RIGHT;