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 727394 - GTK override not working correctly
GTK override not working correctly
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
1.40.x
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-31 16:44 UTC by Cosimo Cecchi
Modified: 2014-04-10 17:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Gtk: fix enabling and disabling the C override helper (2.23 KB, patch)
2014-04-10 17:34 UTC, Giovanni Campagna
none Details | Review
Gtk: fix enabling and disabling the C override helper (2.14 KB, patch)
2014-04-10 17:42 UTC, Giovanni Campagna
committed Details | Review

Description Cosimo Cecchi 2014-03-31 16:44:37 UTC
As described in bug 727267, it seems that under some circumstances the GTK override installed by GJS does not work correctly; the override should be installed when the GTK dependency is satisfied, and disabled completely otherwise.
Comment 1 Giovanni Campagna 2014-03-31 17:38:14 UTC
What harm is done if we install the override without the gtk dependency?
If gtk is not there, the code will never be loaded.

Alternatively, can you write a patch that runs distcheck successfully?
Comment 2 Cosimo Cecchi 2014-03-31 21:26:45 UTC
Giovanni: no harm, but the logic doesn't work correctly I'm afraid.

First, gjs-gtk-util.h does not include config.h, so it will always think ENABLE_GTK is false, leading to the symbol not being exported in the library. In fact, printing the value of GjsPrivate.gtk_container_child_set_property() always gets me "undefined", even with --with-gtk=yes.

Second, the way GJS_ENABLE_GTK is defined will result in the introspection annotation to always be 1, regardless of the value of --with-gtk, which might be why you thought this should have worked previously...
Comment 3 Giovanni Campagna 2014-04-10 17:34:16 UTC
Created attachment 274021 [details] [review]
Gtk: fix enabling and disabling the C override helper

We need to include "config.h" in the introspected header, so that
it knows whether to expose the function or not, and we cannot use
a constant because the introspection scanner is too limited to
recognize conditional constants. So we just check for the function
directly.
Comment 4 Giovanni Campagna 2014-04-10 17:42:00 UTC
Created attachment 274024 [details] [review]
Gtk: fix enabling and disabling the C override helper

We need to include "config.h" in the introspected header, so that
it knows whether to expose the function or not, and we cannot use
a constant because the introspection scanner is too limited to
recognize conditional constants. So we just check for the function
directly.
Comment 5 Cosimo Cecchi 2014-04-10 17:47:42 UTC
Review of attachment 274024 [details] [review]:

Works fine and looks good - thanks.
Comment 6 Giovanni Campagna 2014-04-10 17:55:57 UTC
Attachment 274024 [details] pushed as 3bcd6ba - Gtk: fix enabling and disabling the C override helper