diff --git a/ChangeLog b/ChangeLog index e90957594d..4677aac0df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2004-11-12 Matthias Clasen + Make GDK+ compile with X11R5 (#148032) + + * gdk/x11/xsettings-client.c (xsettings_client_new): + * gdk/x11/gdkproperty-x11.c (_gdk_x11_precache_atoms): Only + use XInternAtoms if it is available. + + * gdk/x11/gdkasync.c: Include XIproto.h if necessary. + + * configure.in: Check for XInternAtoms and X headers needed for + xReply. + * configure.in: Bump version. * === Released 2.5.5 === diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e90957594d..4677aac0df 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,16 @@ 2004-11-12 Matthias Clasen + Make GDK+ compile with X11R5 (#148032) + + * gdk/x11/xsettings-client.c (xsettings_client_new): + * gdk/x11/gdkproperty-x11.c (_gdk_x11_precache_atoms): Only + use XInternAtoms if it is available. + + * gdk/x11/gdkasync.c: Include XIproto.h if necessary. + + * configure.in: Check for XInternAtoms and X headers needed for + xReply. + * configure.in: Bump version. * === Released 2.5.5 === diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e90957594d..4677aac0df 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,16 @@ 2004-11-12 Matthias Clasen + Make GDK+ compile with X11R5 (#148032) + + * gdk/x11/xsettings-client.c (xsettings_client_new): + * gdk/x11/gdkproperty-x11.c (_gdk_x11_precache_atoms): Only + use XInternAtoms if it is available. + + * gdk/x11/gdkasync.c: Include XIproto.h if necessary. + + * configure.in: Check for XInternAtoms and X headers needed for + xReply. + * configure.in: Bump version. * === Released 2.5.5 === diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e90957594d..4677aac0df 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,16 @@ 2004-11-12 Matthias Clasen + Make GDK+ compile with X11R5 (#148032) + + * gdk/x11/xsettings-client.c (xsettings_client_new): + * gdk/x11/gdkproperty-x11.c (_gdk_x11_precache_atoms): Only + use XInternAtoms if it is available. + + * gdk/x11/gdkasync.c: Include XIproto.h if necessary. + + * configure.in: Check for XInternAtoms and X headers needed for + xReply. + * configure.in: Bump version. * === Released 2.5.5 === diff --git a/configure.in b/configure.in index 3706d3ee13..f3cc063a3a 100644 --- a/configure.in +++ b/configure.in @@ -1150,6 +1150,26 @@ if test "x$gdktarget" = "xx11"; then CPPFLAGS="$gtk_save_cppflags" + # Check for xReply + + gtk_save_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + AC_MSG_CHECKING([if is needed for xReply]) + AC_TRY_COMPILE([#include ], + [xReply *rep;], + [AC_MSG_RESULT([no])], + [AC_TRY_COMPILE([#include +#include ], + [xReply *rep;], + [AC_MSG_RESULT([yes]) + AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1, + [Define if needed for xReply])], + [AC_MSG_RESULT([unknown]) + AC_MSG_ERROR([xReply type unavailable. X11 is too old])])]) + + CPPFLAGS="$gtk_save_cppflags" + # Check for shaped window extension AC_CHECK_LIB(Xext, XShapeCombineMask, @@ -1165,10 +1185,18 @@ if test "x$gdktarget" = "xx11"; then , $x_libs_for_checks) + # Check for XInternAtoms (X11R6 specific) + + AC_CHECK_LIB(X11, XInternAtoms, + AC_DEFINE([HAVE_XINTERNATOMS], 1, + [Define to 1 if you have the `XInternAtoms' function.]), + , + $x_libs_for_checks) + # Generic X11R6 check needed for XIM support; we could # probably use this to replace the above, but we'll - # leave the separate XConvertCase check for clarity - + # leave the separate checks for XConvertCase and XInternAtoms + # for clarity have_x11r6=false AC_CHECK_LIB(X11, XAddConnectionWatch, have_x11r6=true, diff --git a/gdk/x11/gdkasync.c b/gdk/x11/gdkasync.c index 812064d07f..61f25fbdf1 100644 --- a/gdk/x11/gdkasync.c +++ b/gdk/x11/gdkasync.c @@ -44,6 +44,9 @@ in this Software without prior written authorization from The Open Group. */ #include +#ifdef NEED_XIPROTO_H_FOR_XREPLY +#include +#endif #include #include "gdkalias.h" #include "gdkasync.h" diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c index c1cb0adfec..2a625af05b 100644 --- a/gdk/x11/gdkproperty-x11.c +++ b/gdk/x11/gdkproperty-x11.c @@ -229,8 +229,16 @@ _gdk_x11_precache_atoms (GdkDisplay *display, } if (n_xatoms) - XInternAtoms (GDK_DISPLAY_XDISPLAY (display), - (char **)xatom_names, n_xatoms, False, xatoms); + { +#ifdef HAVE_XINTERNATOMS + XInternAtoms (GDK_DISPLAY_XDISPLAY (display), + (char **)xatom_names, n_xatoms, False, xatoms); +#else + for (i = 0; i < n_xatoms; i++) + xatoms[i] = XInternAtom (GDK_DISPLAY_XDISPLAY (display), + xatom_names[i], False); +#endif + } for (i = 0; i < n_xatoms; i++) insert_atom_pair (display, atoms[i], xatoms[i]); @@ -414,8 +422,7 @@ gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display, * * Returns the X atom for GDK's default display corresponding to @atom_name. * This function caches the result, so if called repeatedly it is much - * faster than XInternAtom(), which is a round trip to - * the server each time. + * faster than XInternAtom(), which is a round trip to the server each time. * * Return value: a X atom for GDK's default display. **/ diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c index 46a562d0bf..a965d20f07 100644 --- a/gdk/x11/xsettings-client.c +++ b/gdk/x11/xsettings-client.c @@ -480,7 +480,13 @@ xsettings_client_new (Display *display, atom_names[1] = "_XSETTINGS_SETTINGS"; atom_names[2] = "MANAGER"; +#ifdef HAVE_XINTERNATOMS XInternAtoms (display, atom_names, 3, False, atoms); +#else + atoms[0] = XInternAtom (display, atom_names[0], False); + atoms[1] = XInternAtom (display, atom_names[1], False); + atoms[2] = XInternAtom (display, atom_names[2], False); +#endif client->selection_atom = atoms[0]; client->xsettings_atom = atoms[1];