GNOME Bugzilla – Bug 752664
Inspector only shows widget tree if created after startup
Last modified: 2015-07-24 02:00:04 UTC
Using GTK_DEBUG=interactive (or --gtk-debug=interactive) when starting an app pops up the inspector fine. However, the widget tree is in the object list. Using the keyboard shortcut while the app is already running to show the inspector doesn't have this problem and the object list is full of the toplevel windows and the widgets inside said toplevel. In the environment variable case, gtk_window_list_toplevels() is probably being called before any toplevels have been created, whereas using the keyboard shortcut ensures the toplevel is present before the inspector is created.
Given that the inspector is already tied into gtkwindow.c, we could just make it rescan whenever we update the toplevel list.