[gtk+/gestures] drag: Allow gtk_gesture_get_start_point/offset() to be called on ::drag-end



commit 028ad1722a0c6071474522604310e44a06a60075
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon May 12 19:11:53 2014 +0200

    drag: Allow gtk_gesture_get_start_point/offset() to be called on ::drag-end

 gtk/gtkgesturedrag.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkgesturedrag.c b/gtk/gtkgesturedrag.c
index dbcd9c3..141362a 100644
--- a/gtk/gtkgesturedrag.c
+++ b/gtk/gtkgesturedrag.c
@@ -211,8 +211,13 @@ gtk_gesture_drag_get_start_point (GtkGestureDrag *gesture,
                                   gdouble        *y)
 {
   GtkGestureDragPrivate *priv;
+  GdkEventSequence *sequence;
 
-  if (!gtk_gesture_is_recognized (GTK_GESTURE (gesture)))
+  g_return_val_if_fail (GTK_IS_GESTURE_DRAG (gesture), FALSE);
+
+  sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
+
+  if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
     return FALSE;
 
   priv = gtk_gesture_drag_get_instance_private (gesture);
@@ -246,8 +251,13 @@ gtk_gesture_drag_get_offset (GtkGestureDrag *gesture,
                              gdouble        *y)
 {
   GtkGestureDragPrivate *priv;
+  GdkEventSequence *sequence;
+
+  g_return_val_if_fail (GTK_IS_GESTURE_DRAG (gesture), FALSE);
+
+  sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
 
-  if (!gtk_gesture_is_recognized (GTK_GESTURE (gesture)))
+  if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
     return FALSE;
 
   priv = gtk_gesture_drag_get_instance_private (gesture);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]