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 629344 - [API break in GTK+ 2.21.7]: gdk no longer exporting some variables
[API break in GTK+ 2.21.7]: gdk no longer exporting some variables
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
2.21.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-09-11 09:01 UTC by Hussam Al-Tayeb
Modified: 2010-09-13 17:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggested patch (1.17 KB, patch)
2010-09-11 11:23 UTC, Tor Lillqvist
needs-work Details | Review

Description Hussam Al-Tayeb 2010-09-11 09:01:30 UTC
I get the following compile failure:

screen.c: In function ‘wnck_screen_construct’:
screen.c:585:25: error: ‘gdk_display’ undeclared (first use in this function)
screen.c:585:25: note: each undeclared identifier is reported only once for each function it appears in
screen.c: In function ‘wnck_screen_get’:
screen.c:627:3: error: ‘gdk_display’ undeclared (first use in this function)
screen.c: In function ‘_wnck_screen_get_existing’:
screen.c:651:3: error: ‘gdk_display’ undeclared (first use in this function)
screen.c: In function ‘wnck_screen_get_default’:
screen.c:673:20: error: ‘gdk_display’ undeclared (first use in this function)
screen.c: In function ‘wnck_screen_get_for_root’:
screen.c:701:14: error: ‘gdk_display’ undeclared (first use in this function)
make[2]: *** [screen.lo] Error 1
make[2]: Leaving directory `/home/hussam/packages/libwnck/trunk/src/libwnck-2.30.3/libwnck'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/hussam/packages/libwnck/trunk/src/libwnck-2.30.3'
Comment 1 Vincent Untz 2010-09-11 09:17:17 UTC
That's an API break in GTK+ 2.221.7:

* GDK no longer exports variables: gdk_threads_lock, gdk_threads_unlock,
  gdk_threads_mutex and gdk_display are no longer available

This will cause other issues.

(will still fix the issue in libwnck)
Comment 2 Vincent Untz 2010-09-11 09:20:00 UTC
Just to clarify: I see 2.21.7 has not been released and I quoted the NEWS from 2.90.7 :-) But commit a3c3031a0e1b7a6adece0d859f1f682ba7642672 really does this: it requires GDK_COMPILATION to be defined.
Comment 3 Tor Lillqvist 2010-09-11 11:15:57 UTC
Just to make it clear: It is in the master branch that the gdk variables you mention are no longer exported. In the gtk-2-22 branch just gdk_display has been deprecated.

I think the real bug here is that in gtk-2-22, gdkx.h requires GDK_COMPILATION to be defined, in addition to GDK_DISABLE_DEPRECATED and GDK_MULTIHEAD_SAFE being undefined, for gdk_display to be declared.

The intent of the GDK_COMPILATION macro is to indicated that libgdk is being compiled, it is never supposed to be set when compiling libgdk-using code.

So probably just slight confusion here, and what is intended is that gdk_display should be declared if *either* GDK_DISPLAY_DEPRECATED and GDK_MULTIHEAD_SAFE are defined *or* GDK_COMPILATION is defined.
Comment 4 Tor Lillqvist 2010-09-11 11:17:12 UTC
(That is how GDK_COMPILATION is used before in gdkx.h.)
Comment 5 Vincent Untz 2010-09-11 11:22:44 UTC
(In reply to comment #3)
> I think the real bug here is that in gtk-2-22, gdkx.h requires GDK_COMPILATION
> to be defined, in addition to GDK_DISABLE_DEPRECATED and GDK_MULTIHEAD_SAFE
> being undefined, for gdk_display to be declared.
> 
> The intent of the GDK_COMPILATION macro is to indicated that libgdk is being
> compiled, it is never supposed to be set when compiling libgdk-using code.
> 
> So probably just slight confusion here, and what is intended is that
> gdk_display should be declared if *either* GDK_DISPLAY_DEPRECATED and
> GDK_MULTIHEAD_SAFE are defined *or* GDK_COMPILATION is defined.

Yep, agree.

FWIW, I fixed libwnck to stop using gdk_display.
Comment 6 Tor Lillqvist 2010-09-11 11:23:10 UTC
Created attachment 170021 [details] [review]
Suggested patch
Comment 7 Javier Jardón (IRC: jjardon) 2010-09-11 13:05:44 UTC
Review of attachment 170021 [details] [review]:

Only a minor comment:

::: gdk/x11/gdkx.h
@@ +35,3 @@
 G_BEGIN_DECLS
 
+#if (!defined (GDK_DISABLE_DEPRECATED) && !defined (GDK_MULTIHEAD_SAFE) || defined (GDK_COMPILATION)

I think you missed a ")" here, should be
#if (!defined (GDK_DISABLE_DEPRECATED) && !defined (GDK_MULTIHEAD_SAFE)) || defined (GDK_COMPILATION)
Comment 8 Matthias Clasen 2010-09-13 17:15:57 UTC
Thanks, obviously a logic error on my part.