Make GDK+ compile with X11R5 (#148032)

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.
This commit is contained in:
Matthias Clasen 2004-11-12 19:48:43 +00:00 committed by Matthias Clasen
parent 888aeacf51
commit 3b9a31df07
8 changed files with 94 additions and 6 deletions

View File

@ -1,5 +1,16 @@
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 ===

View File

@ -1,5 +1,16 @@
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 ===

View File

@ -1,5 +1,16 @@
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 ===

View File

@ -1,5 +1,16 @@
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 ===

View File

@ -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 <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,
@ -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,

View File

@ -44,6 +44,9 @@ in this Software without prior written authorization from The Open Group.
*/
#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"

View File

@ -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 <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.
**/

View File

@ -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];