inspector: Use unique names for g_object_set_data calls

Otherwise the calls of the different inspector pages might end up
clashing.
This commit is contained in:
Timm Bäder 2018-05-05 09:02:14 +02:00
parent d1cdb9b5cf
commit 64849426ae
4 changed files with 8 additions and 8 deletions

View File

@ -798,11 +798,11 @@ on_hierarchy_changed (GtkWidget *widget,
GtkWidget *toplevel;
if (previous_toplevel)
g_object_set_data (G_OBJECT (previous_toplevel), "controller", NULL);
g_object_set_data (G_OBJECT (previous_toplevel), "object-controller", NULL);
toplevel = gtk_widget_get_toplevel (widget);
controller = gtk_event_controller_key_new ();
g_object_set_data_full (G_OBJECT (toplevel), "controller", controller, g_object_unref);
g_object_set_data_full (G_OBJECT (toplevel), "object-controller", controller, g_object_unref);
g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), widget);
gtk_widget_add_controller (toplevel, controller);

View File

@ -111,11 +111,11 @@ hierarchy_changed (GtkWidget *widget,
GtkWidget *toplevel;
if (previous_toplevel)
g_object_set_data (G_OBJECT (previous_toplevel), "controller", NULL);
g_object_set_data (G_OBJECT (previous_toplevel), "prop-controller", NULL);
toplevel = gtk_widget_get_toplevel (widget);
controller = gtk_event_controller_key_new ();
g_object_set_data_full (G_OBJECT (toplevel), "controller", controller, g_object_unref);
g_object_set_data_full (G_OBJECT (toplevel), "prop-controller", controller, g_object_unref);
g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), widget);
gtk_widget_add_controller (toplevel, controller);
}

View File

@ -478,11 +478,11 @@ on_hierarchy_changed (GtkWidget *widget,
GtkWidget *toplevel;
if (previous_toplevel)
g_object_set_data (G_OBJECT (previous_toplevel), "controller", NULL);
g_object_set_data (G_OBJECT (previous_toplevel), "resource-controller", NULL);
toplevel = gtk_widget_get_toplevel (widget);
controller = gtk_event_controller_key_new ();
g_object_set_data_full (G_OBJECT (toplevel), "controller", controller, g_object_unref);
g_object_set_data_full (G_OBJECT (toplevel), "resource-controller", controller, g_object_unref);
g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), widget);
gtk_widget_add_controller (toplevel, controller);

View File

@ -329,11 +329,11 @@ hierarchy_changed (GtkWidget *widget,
GtkWidget *toplevel;
if (previous_toplevel)
g_object_set_data (G_OBJECT (previous_toplevel), "controller", NULL);
g_object_set_data (G_OBJECT (previous_toplevel), "statistics-controller", NULL);
toplevel = gtk_widget_get_toplevel (widget);
controller = gtk_event_controller_key_new ();
g_object_set_data_full (G_OBJECT (toplevel), "controller", controller, g_object_unref);
g_object_set_data_full (G_OBJECT (toplevel), "statistics-controller", controller, g_object_unref);
g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), widget);
gtk_widget_add_controller (toplevel, controller);