[gtk+/gtk-3-22] inspector: ensure controller is a GtkGesture



commit ecb38bc8247ee3585ca6488d6da49619d60220e2
Author: Christian Hergert <chergert redhat com>
Date:   Sun Nov 20 15:40:10 2016 -0800

    inspector: ensure controller is a GtkGesture
    
    While GtkEventController implementations today are all GtkGesture, it is
    possible to create a GtkEventController manually. This is an extrac check
    to ensure we only add gestures to the list.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774760

 gtk/inspector/gestures.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/inspector/gestures.c b/gtk/inspector/gestures.c
index e448d5f..925a444 100644
--- a/gtk/inspector/gestures.c
+++ b/gtk/inspector/gestures.c
@@ -195,7 +195,12 @@ gtk_inspector_gestures_set_object (GtkInspectorGestures *sl,
     {
       list = _gtk_widget_list_controllers (GTK_WIDGET (object), phase);
       for (l = list; l; l = l->next)
-        g_hash_table_insert (hash, l->data, GINT_TO_POINTER (phase));
+        {
+          GtkEventController *controller = l->data;
+
+          if (GTK_IS_GESTURE (controller))
+            g_hash_table_insert (hash, controller, GINT_TO_POINTER (phase));
+        }
       g_list_free (list);
     }
 


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