I am using GTK.3.15. When attempting to open GTK Inspector using the Ctrl+Shift+I or Ctrl+Shift+D, nothing happens. Does not matter what application or widget I am using. Nothing happens
and my understanding is that this option comes standard on GTK 3.15. Does anyone know how
to use this tool in GTK 3.15?
I got this from https://wiki.gnome.org/Projects/GTK%2B/Inspector:
Looking further, I found Bug #1523929 which indicates that users can install
libgtk-3-dev
which then provides the schema. Note that installinglibgtk-3-dev
may bring in a lot of dependencies.Method 1:
Enable the shortcut:
dconf-editor
withsudo apt-get install dconf-editor
org
>gtk
>settings
>debug
enable-inspector-keybinding
totrue
Method 2:
Run the program to debug with the
GTK_DEBUG
variable:Instead of running the program to debug as usual (
myprogram --argument
) you only need to run it of this way (GTK_DEBUG=interactive myprogram --argument
)Also you can export that variable with
export GTK_DEBUG=interactive
and then run the program.The wiki page for the Inspector seems to be out of date, because it's clearly steered a lot of people in a lot of wrong directions.
This is nonsense. You always have to use the shortcut, no matter what.
Again, nonsense. Ctrl+Shift+D does nothing. The only keybinding I've ever seen work is Ctrl+Shift+I, which is not an interactive picker, it just opens the Inspector. I suspect the "pick a widget"-style functionality is a relic from the pre-Wayland days.
To get to the inspector, you have to do all of these things:
Install the
gtk3-devel
/libgtk-3-dev
packageEnable the dconf key
/org/gtk/settings/debug/enable-inspector-keybinding
/ GSettings keyorg.gtk.Settings.Debug enable-inspector-keybinding
(same thing) and optionally disableorg.gtk.Settings.Debug inspector-warning
.(Note that "keybinding" is singular, not plural. AFAICT that's accurate, there's only the one.)
Run a program with
GTK_DEBUG=1
in the environment.(The value "
interactive
" is not special, AFAICT, any value will work except perhaps0
.)When the application is open and focused, type Ctrl+Shift+I
The inspector window should open. Tested on both Wayland and X11. If any of the steps are missing, no dice. The inspector cannot be used without
GTK_DEBUG
, and even withGTK_DEBUG
it will not open if the keybinding is not enabled.Note also that
org.gtk.gtk4.Settings.Debug
has its ownenable-inspector-keybinding
key. But that one defaults totrue
, so this should work for GTK4 apps as well.