From bfa2e9a6aa50fc2e0ba65290df0aa5f0969edf02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cardona?= Date: Fri, 11 Sep 2009 21:15:52 +0200 Subject: [PATCH] Check for XRR* functions using library version instead of proto version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit randrproto 1.3 can be installed with (lib)xrandr 1.2 which causes linking errors. This patch checks that libXrandr 1.3 is available or not. Signed-off-by: RĂ©mi Cardona --- configure.in | 5 ++++- libgnome-desktop/gnome-rr.c | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 12e2fb9..a0309af 100644 --- a/configure.in +++ b/configure.in @@ -114,7 +114,10 @@ AC_SUBST(STARTUP_NOTIFICATION_PACKAGE) dnl we need x11 for GnomeBG PKG_CHECK_MODULES(XLIB, x11 xrandr >= $XRANDR_REQUIRED, - X11_PACKAGE=x11, + [X11_PACKAGE=x11 + PKG_CHECK_EXISTS([xrandr >= 1.3], + [AC_DEFINE(HAVE_XRANDR_13, 1, [xrandr 1.3 available])]) + ], [X11_PACKAGE= AC_PATH_XTRA if test "x$no_x" = xyes; then diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c index 0b95e3a..8c20355 100644 --- a/libgnome-desktop/gnome-rr.c +++ b/libgnome-desktop/gnome-rr.c @@ -338,15 +338,13 @@ fill_out_screen_info (Display *xdisplay, * XRRGetScreenResources, however it is available only * in RandR 1.3 or higher */ -#if (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3)) +#ifdef HAVE_XRANDR_13 /* Runtime check for RandR 1.3 or higher */ if (info->screen->rr_major_version == 1 && info->screen->rr_minor_version >= 3) resources = XRRGetScreenResourcesCurrent (xdisplay, xroot); else - resources = XRRGetScreenResources (xdisplay, xroot); -#else - resources = XRRGetScreenResources (xdisplay, xroot); #endif + resources = XRRGetScreenResources (xdisplay, xroot); } if (resources) -- 1.6.4.2