[gtk+] inspector: Show hidden windows in the inspector



commit 355afc8f56c318ca8832987c905475de8375531d
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Sep 12 13:46:05 2014 +0200

    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

 gtk/inspector/widget-tree.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/widget-tree.c b/gtk/inspector/widget-tree.c
index 1de80c8..a08f04a 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));


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