[gtk+] inspector: ensure controller is a GtkGesture
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: ensure controller is a GtkGesture
- Date: Wed, 23 Nov 2016 22:03:28 +0000 (UTC)
commit c14c9aca34534d02cb5dc78f8f404da6f25a4bac
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]