How do I open GTK Inspector?

I got this from https://wiki.gnome.org/Projects/GTK%2B/Inspector:

GtkInspector is the built-in interactive debugging support in GTK+. It was added in GTK+ 3.14, based on a copy of the well-estabished gtkparasite.

The debugger is disabled by default. To enable it run in a terminal:

gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true

And launch it pressing on the keyboard Control-Shift-I or Control-Shift-D.

If you don't want to use the shortcuts, you can also run it temporarily directly when running your app with:

GTK_DEBUG=interactive your-app

Looking further, I found Bug #1523929 which indicates that users can install libgtk-3-dev which then provides the schema. Note that installing libgtk-3-dev may bring in a lot of dependencies.


Method 1:


Enable the shortcut:

  1. Install dconf-editor with sudo apt-get install dconf-editor
  2. Navigate to org > gtk > settings > debug
  3. Set enable-inspector-keybinding to true
  4. Try the shortcut.

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.