From ecec99eedb5886191cd03e3e02cd6bc7e384f350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 12 Jul 2018 17:03:48 +0200 Subject: [PATCH] x11: Require xrandr 1.5 at build time While leaving the runtime checks in place, requiring xrandr 1.5 at build time allows us to remove some seemingly unnecessary conditional inclusion of functionality. --- configure.ac | 17 ++--------------- src/backends/x11/meta-monitor-manager-xrandr.c | 10 ---------- src/core/display.c | 4 ---- src/core/main.c | 5 ----- src/x11/meta-x11-display.c | 3 --- 5 files changed, 2 insertions(+), 37 deletions(-) diff --git a/configure.ac b/configure.ac index 97cdac859..eb1215cbc 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,7 @@ MUTTER_PC_MODULES=" xkbcommon >= 0.4.3 xkbcommon-x11 xrender + xrandr >= 1.5.0 x11-xcb xcb-randr xcb-res @@ -381,21 +382,7 @@ fi AC_DEFINE_UNQUOTED([XKB_BASE], ["`$PKG_CONFIG --variable xkb_base xkeyboard-config`"], [XKB base dir]) -RANDR_LIBS= -found_randr=no -AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration, - [AC_CHECK_HEADER(X11/extensions/Xrandr.h, - RANDR_LIBS=-lXrandr found_randr=yes,, - [#include ])], - , -lXext $ALL_X_LIBS) - -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" +MUTTER_LIBS="$MUTTER_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lm" found_sm=no case "$MUTTER_LIBS" in diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index 6a75f3141..21ee50e97 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -70,9 +70,7 @@ struct _MetaMonitorManagerXrandr xcb_timestamp_t last_xrandr_set_timestamp; -#ifdef HAVE_XRANDR15 GHashTable *tiled_monitor_atoms; -#endif /* HAVE_XRANDR15 */ float *supported_scales; int n_supported_scales; @@ -85,14 +83,12 @@ struct _MetaMonitorManagerXrandrClass G_DEFINE_TYPE (MetaMonitorManagerXrandr, meta_monitor_manager_xrandr, META_TYPE_MONITOR_MANAGER); -#ifdef HAVE_XRANDR15 typedef struct _MetaMonitorXrandrData { Atom xrandr_name; } MetaMonitorXrandrData; GQuark quark_meta_monitor_xrandr_data; -#endif /* HAVE_RANDR15 */ Display * meta_monitor_manager_xrandr_get_xdisplay (MetaMonitorManagerXrandr *manager_xrandr) @@ -669,7 +665,6 @@ meta_monitor_manager_xrandr_set_crtc_gamma (MetaMonitorManager *manager, XRRFreeGamma (gamma); } -#ifdef HAVE_XRANDR15 static MetaMonitorXrandrData * meta_monitor_xrandr_data_from_monitor (MetaMonitor *monitor) { @@ -830,7 +825,6 @@ meta_monitor_manager_xrandr_init_monitors (MetaMonitorManagerXrandr *manager_xra } XRRFreeMonitors (m); } -#endif static gboolean meta_monitor_manager_xrandr_is_transform_handled (MetaMonitorManager *manager, @@ -999,7 +993,6 @@ meta_monitor_manager_xrandr_constructed (GObject *object) 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)) @@ -1008,7 +1001,6 @@ meta_monitor_manager_xrandr_constructed (GObject *object) manager_xrandr->tiled_monitor_atoms = g_hash_table_new (NULL, NULL); } meta_monitor_manager_xrandr_init_monitors (manager_xrandr); -#endif } G_OBJECT_CLASS (meta_monitor_manager_xrandr_parent_class)->constructed (object); @@ -1047,10 +1039,8 @@ meta_monitor_manager_xrandr_class_init (MetaMonitorManagerXrandrClass *klass) manager_class->change_backlight = meta_monitor_manager_xrandr_change_backlight; manager_class->get_crtc_gamma = meta_monitor_manager_xrandr_get_crtc_gamma; manager_class->set_crtc_gamma = meta_monitor_manager_xrandr_set_crtc_gamma; -#ifdef HAVE_XRANDR15 manager_class->tiled_monitor_added = meta_monitor_manager_xrandr_tiled_monitor_added; manager_class->tiled_monitor_removed = meta_monitor_manager_xrandr_tiled_monitor_removed; -#endif manager_class->is_transform_handled = meta_monitor_manager_xrandr_is_transform_handled; manager_class->calculate_monitor_mode_scale = meta_monitor_manager_xrandr_calculate_monitor_mode_scale; manager_class->calculate_supported_scales = meta_monitor_manager_xrandr_calculate_supported_scales; diff --git a/src/core/display.c b/src/core/display.c index 69a2b2d32..0bd245a92 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -42,10 +42,6 @@ #include #include -#ifdef HAVE_RANDR -#include -#endif - #include "backends/meta-cursor-sprite-xcursor.h" #include "backends/meta-cursor-tracker-private.h" #include "backends/meta-idle-monitor-dbus.h" diff --git a/src/core/main.c b/src/core/main.c index b63664173..e8464720f 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -118,11 +118,6 @@ static void prefs_changed_callback (MetaPreference pref, static void meta_print_compilation_info (void) { -#ifdef HAVE_RANDR - meta_verbose ("Compiled with randr extension\n"); -#else - meta_verbose ("Compiled without randr extension\n"); -#endif #ifdef HAVE_STARTUP_NOTIFICATION meta_verbose ("Compiled with startup notification\n"); #else diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index 1a9ad74f2..50991ecf8 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -45,10 +45,7 @@ #include #include #include - -#ifdef HAVE_RANDR #include -#endif #include "backends/meta-backend-private.h" #include "backends/meta-logical-monitor.h"