[gtk/gtk-3-22] Merge branch 'gesture-docs' into 'master'



commit e0206cafcdf3c2378c79503f88a156b0a410a9a9
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed May 30 02:13:04 2018 +0000

    Merge branch 'gesture-docs' into 'master'
    
    Gesture stuff
    
    See merge request GNOME/gtk!169
    
    (cherry picked from commit 8b24d59cde9410db28c7b61d323fa8b1f0180300)
    
    334c7911 gesture: Fix get_last_event() docs
    e9765c04 gesture: Fix code snippet
    4d2b39d9 gesturemultipress: Don’t fire ::released after ::cancel

 gtk/gtkgesture.c           | 6 +++---
 gtk/gtkgesturemultipress.c | 7 +++++--
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index f8656e589e..798c7a29be 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -1102,7 +1102,7 @@ gtk_gesture_get_sequence_state (GtkGesture       *gesture,
  *                         GdkEventSequence *sequence,
  *                         gpointer          user_data)
  * {
- *   gtk_gesture_set_sequence_state (first_gesture, sequence, GTK_EVENT_SEQUENCE_ACCEPTED);
+ *   gtk_gesture_set_sequence_state (first_gesture, sequence, GTK_EVENT_SEQUENCE_CLAIMED);
  *   gtk_gesture_set_sequence_state (second_gesture, sequence, GTK_EVENT_SEQUENCE_DENIED);
  * }
  *
@@ -1111,7 +1111,7 @@ gtk_gesture_get_sequence_state (GtkGesture       *gesture,
  *                          GdkEventSequence *sequence,
  *                          gpointer          user_data)
  * {
- *   if (gtk_gesture_get_sequence_state (first_gesture, sequence) == GTK_EVENT_SEQUENCE_ACCEPTED)
+ *   if (gtk_gesture_get_sequence_state (first_gesture, sequence) == GTK_EVENT_SEQUENCE_CLAIMED)
  *     gtk_gesture_set_sequence_state (second_gesture, sequence, GTK_EVENT_SEQUENCE_DENIED);
  * }
  * ]|
@@ -1270,7 +1270,7 @@ gtk_gesture_get_last_updated_sequence (GtkGesture *gesture)
 /**
  * gtk_gesture_get_last_event:
  * @gesture: a #GtkGesture
- * @sequence: a #GdkEventSequence
+ * @sequence: (nullable): a #GdkEventSequence
  *
  * Returns the last event that was processed for @sequence.
  *
diff --git a/gtk/gtkgesturemultipress.c b/gtk/gtkgesturemultipress.c
index f2fa07f1c3..ef17c1d4ab 100644
--- a/gtk/gtkgesturemultipress.c
+++ b/gtk/gtkgesturemultipress.c
@@ -273,13 +273,16 @@ gtk_gesture_multi_press_end (GtkGesture       *gesture,
   GtkGestureMultiPressPrivate *priv;
   GdkEventSequence *current;
   gdouble x, y;
+  gboolean interpreted;
+  GtkEventSequenceState state;
 
   multi_press = GTK_GESTURE_MULTI_PRESS (gesture);
   priv = gtk_gesture_multi_press_get_instance_private (multi_press);
   current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
-  gtk_gesture_get_point (gesture, current, &x, &y);
+  interpreted = gtk_gesture_get_point (gesture, current, &x, &y);
+  state = gtk_gesture_get_sequence_state (gesture, current);
 
-  if (gtk_gesture_get_sequence_state (gesture, current) != GTK_EVENT_SEQUENCE_DENIED)
+  if (state != GTK_EVENT_SEQUENCE_DENIED && interpreted)
     g_signal_emit (gesture, signals[RELEASED], 0, priv->n_release, x, y);
 
   priv->n_release = 0;


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