2004-11-12 Matthias Clasen <mclasen@redhat.com>
+ 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 ===
2004-11-12 Matthias Clasen <mclasen@redhat.com>
+ 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 ===
2004-11-12 Matthias Clasen <mclasen@redhat.com>
+ 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 ===
2004-11-12 Matthias Clasen <mclasen@redhat.com>
+ 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 ===
CPPFLAGS="$gtk_save_cppflags"
+ # Check for xReply
+
+ gtk_save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
+ AC_TRY_COMPILE([#include <X11/Xlibint.h>],
+ [xReply *rep;],
+ [AC_MSG_RESULT([no])],
+ [AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
+#include <X11/Xlibint.h>],
+ [xReply *rep;],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
+ [Define if <X11/extensions/XIproto.h> 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,
,
$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,
*/
#include <config.h>
+#ifdef NEED_XIPROTO_H_FOR_XREPLY
+#include <X11/extensions/XIproto.h>
+#endif
#include <X11/Xlibint.h>
#include "gdkalias.h"
#include "gdkasync.h"
}
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]);
*
* 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 <function>XInternAtom()</function>, 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.
**/
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];