summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-rr.c44
1 files changed, 9 insertions, 35 deletions
diff --git a/libmate-desktop/mate-rr.c b/libmate-desktop/mate-rr.c
index 921190a..e00f1b1 100644
--- a/libmate-desktop/mate-rr.c
+++ b/libmate-desktop/mate-rr.c
@@ -60,14 +60,6 @@ typedef int Rotation;
#define RR_Reflect_Y 32
#endif
-#ifdef HAVE_RANDR
-#define RANDR_LIBRARY_IS_AT_LEAST_1_3 (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3))
-#else
-#define RANDR_LIBRARY_IS_AT_LEAST_1_3 0
-#endif
-
-#define SERVERS_RANDR_IS_AT_LEAST_1_3(priv) (priv->rr_major_version > 1 || (priv->rr_major_version == 1 && priv->rr_minor_version >= 3))
-
enum {
SCREEN_PROP_0,
SCREEN_PROP_GDK_SCREEN,
@@ -457,20 +449,7 @@ fill_out_screen_info (Display *xdisplay,
if (needs_reprobe)
resources = XRRGetScreenResources (xdisplay, xroot);
else
- {
- /* XRRGetScreenResourcesCurrent is less expensive than
- * XRRGetScreenResources, however it is available only
- * in RandR 1.3 or higher
- */
-#if RANDR_LIBRARY_IS_AT_LEAST_1_3
- if (SERVERS_RANDR_IS_AT_LEAST_1_3 (priv))
- resources = XRRGetScreenResourcesCurrent (xdisplay, xroot);
- else
- resources = XRRGetScreenResources (xdisplay, xroot);
-#else
- resources = XRRGetScreenResources (xdisplay, xroot);
-#endif
- }
+ resources = XRRGetScreenResourcesCurrent (xdisplay, xroot);
if (resources)
{
@@ -521,17 +500,13 @@ fill_out_screen_info (Display *xdisplay,
}
info->primary = None;
-#if RANDR_LIBRARY_IS_AT_LEAST_1_3
- if (SERVERS_RANDR_IS_AT_LEAST_1_3 (priv)) {
- gdk_error_trap_push ();
- info->primary = XRRGetOutputPrimary (xdisplay, xroot);
- #if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_push ();
+ info->primary = XRRGetOutputPrimary (xdisplay, xroot);
+#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
- #else
+#else
gdk_flush ();
gdk_error_trap_pop (); /* ignore error */
- #endif
- }
#endif
return TRUE;
@@ -708,9 +683,9 @@ mate_rr_screen_initable_init (GInitable *initable, GCancellable *canc, GError **
priv->randr_event_base = event_base;
XRRQueryVersion (dpy, &priv->rr_major_version, &priv->rr_minor_version);
- if (priv->rr_major_version < 1 || (priv->rr_major_version == 1 && priv->rr_minor_version < 2)) {
+ if (priv->rr_major_version < 1 || (priv->rr_major_version == 1 && priv->rr_minor_version < 3)) {
g_set_error (error, MATE_RR_ERROR, MATE_RR_ERROR_NO_RANDR_EXTENSION,
- "RANDR extension is too old (must be at least 1.2)");
+ "RANDR extension is too old (must be at least 1.3)");
return FALSE;
}
@@ -1620,13 +1595,13 @@ void
mate_rr_screen_set_primary_output (MateRRScreen *screen,
MateRROutput *output)
{
+#ifdef HAVE_RANDR
MateRRScreenPrivate *priv;
g_return_if_fail (MATE_IS_RR_SCREEN (screen));
priv = screen->priv;
-#if RANDR_LIBRARY_IS_AT_LEAST_1_3
RROutput id;
if (output)
@@ -1634,8 +1609,7 @@ mate_rr_screen_set_primary_output (MateRRScreen *screen,
else
id = None;
- if (SERVERS_RANDR_IS_AT_LEAST_1_3 (priv))
- XRRSetOutputPrimary (priv->xdisplay, priv->xroot, id);
+ XRRSetOutputPrimary (priv->xdisplay, priv->xroot, id);
#endif
}