From 74f1af8766f91cadf87d976cf43a7006a7ab9132 Mon Sep 17 00:00:00 2001 From: Monsta Date: Sun, 23 Aug 2015 16:02:09 +0300 Subject: drop xrandr 1.2 compatibility (it's ancient) --- README | 2 +- configure.ac | 6 +----- src/gpm-brightness.c | 48 ++---------------------------------------------- 3 files changed, 4 insertions(+), 52 deletions(-) diff --git a/README b/README index cd91eeb..1a66e2b 100644 --- a/README +++ b/README @@ -21,7 +21,7 @@ To build, MATE Power Manager requires - Cairo (1.0.0 or later) - Unique (0.9.4 or later) - libmate-panel-applet (1.5.0 or later) - - xrandr (1.2.0 or later) + - xrandr (1.3.0 or later) - Canberra (0.10 or later) - UPower (0.9.5 or later) diff --git a/configure.ac b/configure.ac index 4bb558c..c27a7a2 100644 --- a/configure.ac +++ b/configure.ac @@ -122,7 +122,7 @@ LIBNOTIFY_REQUIRED=0.7.0 CAIRO_REQUIRED=1.0.0 UNIQUE_REQUIRED=0.9.4 LIBPANEL_REQUIRED=1.5.0 -XRANDR_REQUIRED=1.2.0 +XRANDR_REQUIRED=1.3.0 CANBERRA_REQUIRED=0.10 UPOWER_REQUIRED=0.9.5 MATE_DESKTOP_REQUIRED=1.9.0 @@ -181,10 +181,6 @@ PKG_CHECK_MODULES(X11, [ PKG_CHECK_MODULES(X11, x11 xrender) -PKG_CHECK_EXISTS( - [xrandr >= 1.3], - [AC_DEFINE(HAVE_XRANDR_13, 1, [xrandr 1.3 available])]) - PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED) PKG_CHECK_MODULES(UNIQUE, unique-$LIBUNIQUE_VERSION) diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c index acfffc2..8600474 100644 --- a/src/gpm-brightness.c +++ b/src/gpm-brightness.c @@ -61,9 +61,6 @@ struct GpmBrightnessPrivate GdkWindow *root_window; guint shared_value; gboolean has_extension; -#ifdef HAVE_XRANDR_13 - gboolean has_randr13; -#endif gboolean hw_changed; /* A cache of XRRScreenResources is used as XRRGetScreenResources is expensive */ GPtrArray *resources; @@ -269,7 +266,7 @@ gpm_brightness_setup_display (GpmBrightness *brightness) egg_debug ("RandR extension missing"); return FALSE; } - if (major < 1 || (major == 1 && minor < 2)) { + if (major < 1 || (major == 1 && minor < 3)) { egg_debug ("RandR version %d.%d too old", major, minor); return FALSE; } @@ -282,34 +279,6 @@ gpm_brightness_setup_display (GpmBrightness *brightness) return TRUE; } -#ifdef HAVE_XRANDR_13 -/** - * gpm_brightness_setup_version: Check whether xserver really supports xrandr-1.3 features. - **/ -static gboolean -gpm_brightness_setup_version (GpmBrightness *brightness) -{ - gint major, minor; - - g_return_val_if_fail (GPM_IS_BRIGHTNESS (brightness), FALSE); - - /* get the display */ - brightness->priv->dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default()); - if (!brightness->priv->dpy) { - egg_error ("Cannot open display"); - return FALSE; - } - if (!XRRQueryVersion (brightness->priv->dpy, &major, &minor)) { - return FALSE; - } - if (major == 1 && minor < 3) { - egg_debug ("RandR version %d.%d does not support XRRGetScreenResourcesCurrent", major, minor); - return FALSE; - } - return TRUE; -} -#endif - /** * gpm_brightness_output_get_limits: **/ @@ -877,17 +846,7 @@ gpm_brightness_update_cache (GpmBrightness *brightness) } root = RootWindow (brightness->priv->dpy, screen); - /* XRRGetScreenResourcesCurrent is less expensive than - XRRGetScreenResources, however it is available only - in RandR 1.3 or higher and of course xserver needs - to support it. - */ -#ifdef HAVE_XRANDR_13 - if (brightness->priv->has_randr13) - resource = XRRGetScreenResourcesCurrent (brightness->priv->dpy, root); - else -#endif - resource = XRRGetScreenResources (brightness->priv->dpy, root); + resource = XRRGetScreenResourcesCurrent (brightness->priv->dpy, root); if (resource != NULL) { egg_debug ("adding resource %p", resource); @@ -974,9 +933,6 @@ gpm_brightness_init (GpmBrightness *brightness) /* can we do this */ brightness->priv->has_extension = gpm_brightness_setup_display (brightness); -#ifdef HAVE_XRANDR_13 - brightness->priv->has_randr13 = gpm_brightness_setup_version (brightness); -#endif if (brightness->priv->has_extension == FALSE) egg_debug ("no XRANDR extension"); -- cgit v1.2.1