GNOME Bugzilla – Bug 727394
GTK override not working correctly
Last modified: 2014-04-10 17:56:01 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.
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?
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...
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.
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.
Review of attachment 274024 [details] [review]: Works fine and looks good - thanks.
Attachment 274024 [details] pushed as 3bcd6ba - Gtk: fix enabling and disabling the C override helper