summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-09-12 13:46:05 +0200
committerMatthias Clasen <mclasen@redhat.com>2014-09-14 08:47:05 -0400
commit355afc8f56c318ca8832987c905475de8375531d (patch)
tree643232a73c33bcec18bc3944feabe55948151cff
parent3ad8bae1c450df0e4a43c78fc07d659dec08f4cc (diff)
downloadgtk+-355afc8f56c318ca8832987c905475de8375531d.tar.gz
inspector: Show hidden windows in the inspector
This allows us to access otherwise hidden windows, which can be useful to provide better debug information than would be available through other means. https://bugzilla.gnome.org/show_bug.cgi?id=736557
-rw-r--r--gtk/inspector/widget-tree.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/inspector/widget-tree.c b/gtk/inspector/widget-tree.c
index 1de80c859a..a08f04a3e8 100644
--- a/gtk/inspector/widget-tree.c
+++ b/gtk/inspector/widget-tree.c
@@ -486,11 +486,30 @@ void
gtk_inspector_widget_tree_scan (GtkInspectorWidgetTree *wt,
GtkWidget *window)
{
+ GtkWidget *inspector_win;
+ GList *toplevels, *l;
+
gtk_tree_store_clear (wt->priv->model);
g_hash_table_remove_all (wt->priv->iters);
gtk_inspector_widget_tree_append_object (wt, G_OBJECT (gtk_settings_get_default ()), NULL, NULL);
if (g_application_get_default ())
gtk_inspector_widget_tree_append_object (wt, G_OBJECT (g_application_get_default ()), NULL, NULL);
+
+ inspector_win = gtk_widget_get_toplevel (GTK_WIDGET (wt));
+ toplevels = gtk_window_list_toplevels ();
+ for (l = toplevels; l; l = l->next)
+ {
+ if (GTK_IS_WINDOW (l->data) &&
+ gtk_window_get_window_type (l->data) == GTK_WINDOW_TOPLEVEL &&
+ l->data != window &&
+ l->data != inspector_win)
+ {
+ g_message ("adding %s", gtk_window_get_title (l->data));
+ gtk_inspector_widget_tree_append_object (wt, G_OBJECT (l->data), NULL, NULL);
+ }
+ }
+ g_list_free (toplevels);
+
gtk_inspector_widget_tree_append_object (wt, G_OBJECT (window), NULL, NULL);
gtk_tree_view_columns_autosize (GTK_TREE_VIEW (wt));