After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776807 - GtkInspector doesn't show up when Gtk is initialized through option group
GtkInspector doesn't show up when Gtk is initialized through option group
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Debugging
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-01-03 11:57 UTC by Arnaud Rebillout
Modified: 2017-01-08 00:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make GTK_DEBUG=interactive work better (1.18 KB, patch)
2017-01-04 19:43 UTC, Matthias Clasen
committed Details | Review

Description Arnaud Rebillout 2017-01-03 11:57:15 UTC
There are different ways to initialize GTK+, and as stated in the documentation:

> Note that there are some alternative ways to initialize GTK+: if you are calling gtk_parse_args(), gtk_init_check(), gtk_init_with_args() or g_option_context_parse() with the option group returned by gtk_get_option_group(), you don’t have to call gtk_init().

However, I noticed that when I use `gtk_get_option_group()` along with `g_option_context_parse()`, the GtkInspector doesn't show up.

An easy workaround is to invoke `gtk_init()` additionally to the option group calls.

An simple example is available here:

https://gist.github.com/elboulangero/bb31a33150d3f4170fe2b698536c104d

Cheers
Comment 1 Matthias Clasen 2017-01-04 19:43:33 UTC
Created attachment 342890 [details] [review]
Make GTK_DEBUG=interactive work better

We currently have various ways to initialize GTK+, and not
all of them were supporting this way of bringing up the
inspector. Fix this.
Comment 2 Matthias Clasen 2017-01-04 19:49:15 UTC
Does this patch work for you ?
Comment 3 Arnaud Rebillout 2017-01-05 01:59:39 UTC
Hi,

yes the patch works and fixes the issue.

Thanks !
Comment 4 Matthias Clasen 2017-01-08 00:16:33 UTC
Attachment 342890 [details] pushed as 507a1e4 - Make GTK_DEBUG=interactive work better