[mutter] backends/x11: add a flag to denote randr 1.5 is in use.
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends/x11: add a flag to denote randr 1.5 is in use.
- Date: Mon, 1 Jun 2015 16:39:19 +0000 (UTC)
commit ef296031cbf0883135b7a1f436c6a69f75122efe
Author: Dave Airlie <airlied redhat com>
Date: Tue Mar 31 10:38:44 2015 +1000
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.
configure.ac | 2 ++
src/backends/x11/meta-monitor-manager-xrandr.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7cb832b..88d162a 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 70bef2e..bbccce9 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
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]