summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-03-31 10:38:44 +1000
committerDave Airlie <airlied@redhat.com>2015-05-19 09:34:54 +1000
commitbaa5e7def7dcdbf4bb86d873bec3e4ef35bbfb06 (patch)
tree4cc1a34a96bd9e8f46f6208645687c2007557367
parentf435b81eb41b3755458946a010729f5d0f97ae38 (diff)
backends/x11: add a flag to denote randr 1.5 is in use.
If the server reports randr 1.5, just cache the information for later patches to use.
-rw-r--r--configure.ac2
-rw-r--r--src/backends/x11/meta-monitor-manager-xrandr.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 135445e7..5c0931ed 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 387a0ce8..39ee0798 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
@@ -1254,6 +1255,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,
@@ -1261,6 +1263,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
}
}