diff options
author | Monsta <[email protected]> | 2015-08-23 15:21:18 +0300 |
---|---|---|
committer | Monsta <[email protected]> | 2015-09-02 16:03:25 +0300 |
commit | 86bf08b6add93ffc59f0ad8557bc31b4f0fee1f7 (patch) | |
tree | b41cbc4611092d74e01155b20106221495bea974 | |
parent | f66c53e4be89b1b5569077c32323c0858da83a25 (diff) | |
download | mate-desktop-86bf08b6add93ffc59f0ad8557bc31b4f0fee1f7.tar.bz2 mate-desktop-86bf08b6add93ffc59f0ad8557bc31b4f0fee1f7.tar.xz |
drop xrandr 1.2 compatibility (it's ancient)
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | libmate-desktop/mate-rr.c | 44 |
2 files changed, 10 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac index ba09b37..94e1f62 100644 --- a/configure.ac +++ b/configure.ac @@ -154,7 +154,7 @@ esac GDK_PIXBUF_REQUIRED=2.4.0 GLIB_REQUIRED=2.36.0 GIO_REQUIRED=2.26.0 -XRANDR_REQUIRED=1.2 +XRANDR_REQUIRED=1.3 AC_SUBST(GTK_API_VERSION) AC_SUBST(GLIB_REQUIRED) 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 } |