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
This commit is contained in:
Christian Hergert 2016-11-20 15:40:10 -08:00
parent 10a7c65f47
commit c14c9aca34

View File

@ -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);
}