diff --git a/configure.ac b/configure.ac index 7cb832b68..88d162a5c 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,8 @@ AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration, if test "x$found_randr" = "xyes"; then AC_DEFINE(HAVE_RANDR, , [Have the Xrandr extension library]) + PKG_CHECK_EXISTS([xrandr >= 1.5.0], + AC_DEFINE([HAVE_XRANDR15],[1],[Define if you have support for XRandR 1.5 or greater])) fi MUTTER_LIBS="$MUTTER_LIBS $RANDR_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lm" diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index 70bef2ef7..bbccce9da 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -58,6 +58,7 @@ struct _MetaMonitorManagerXrandr XRRScreenResources *resources; int rr_event_base; int rr_error_base; + gboolean has_randr15; }; struct _MetaMonitorManagerXrandrClass @@ -1228,6 +1229,7 @@ meta_monitor_manager_xrandr_init (MetaMonitorManagerXrandr *manager_xrandr) } else { + int major_version, minor_version; /* We only use ScreenChangeNotify, but GDK uses the others, and we don't want to step on its toes */ XRRSelectInput (manager_xrandr->xdisplay, @@ -1235,6 +1237,16 @@ meta_monitor_manager_xrandr_init (MetaMonitorManagerXrandr *manager_xrandr) RRScreenChangeNotifyMask | RRCrtcChangeNotifyMask | RROutputPropertyNotifyMask); + + manager_xrandr->has_randr15 = FALSE; + XRRQueryVersion (manager_xrandr->xdisplay, &major_version, + &minor_version); +#ifdef HAVE_XRANDR15 + if (major_version > 1 || + (major_version == 1 && + minor_version >= 5)) + manager_xrandr->has_randr15 = TRUE; +#endif } }