[clutter/wip/carlosg/touchpad-gestures: 1/7] swipe-action: Prepare for multifinger swipes
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/carlosg/touchpad-gestures: 1/7] swipe-action: Prepare for multifinger swipes
- Date: Fri, 22 May 2015 17:16:21 +0000 (UTC)
commit dc605e0589dc4db7fdda31a184c786c922c0d198
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri May 22 13:19:29 2015 +0200
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
clutter/clutter-swipe-action.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter-swipe-action.c b/clutter/clutter-swipe-action.c
index 452a5a0..ed79ebf 100644
--- a/clutter/clutter-swipe-action.c
+++ b/clutter/clutter-swipe-action.c
@@ -145,14 +145,14 @@ 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);
+ 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]