mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 11:00:54 -05:00
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.
This commit is contained in:
parent
2f4a68c8c3
commit
ecec99eedb
17
configure.ac
17
configure.ac
@ -100,6 +100,7 @@ MUTTER_PC_MODULES="
|
|||||||
xkbcommon >= 0.4.3
|
xkbcommon >= 0.4.3
|
||||||
xkbcommon-x11
|
xkbcommon-x11
|
||||||
xrender
|
xrender
|
||||||
|
xrandr >= 1.5.0
|
||||||
x11-xcb
|
x11-xcb
|
||||||
xcb-randr
|
xcb-randr
|
||||||
xcb-res
|
xcb-res
|
||||||
@ -381,21 +382,7 @@ fi
|
|||||||
AC_DEFINE_UNQUOTED([XKB_BASE], ["`$PKG_CONFIG --variable xkb_base xkeyboard-config`"],
|
AC_DEFINE_UNQUOTED([XKB_BASE], ["`$PKG_CONFIG --variable xkb_base xkeyboard-config`"],
|
||||||
[XKB base dir])
|
[XKB base dir])
|
||||||
|
|
||||||
RANDR_LIBS=
|
MUTTER_LIBS="$MUTTER_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lm"
|
||||||
found_randr=no
|
|
||||||
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
|
|
||||||
[AC_CHECK_HEADER(X11/extensions/Xrandr.h,
|
|
||||||
RANDR_LIBS=-lXrandr found_randr=yes,,
|
|
||||||
[#include <X11/Xlib.h>])],
|
|
||||||
, -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"
|
|
||||||
|
|
||||||
found_sm=no
|
found_sm=no
|
||||||
case "$MUTTER_LIBS" in
|
case "$MUTTER_LIBS" in
|
||||||
|
@ -70,9 +70,7 @@ struct _MetaMonitorManagerXrandr
|
|||||||
|
|
||||||
xcb_timestamp_t last_xrandr_set_timestamp;
|
xcb_timestamp_t last_xrandr_set_timestamp;
|
||||||
|
|
||||||
#ifdef HAVE_XRANDR15
|
|
||||||
GHashTable *tiled_monitor_atoms;
|
GHashTable *tiled_monitor_atoms;
|
||||||
#endif /* HAVE_XRANDR15 */
|
|
||||||
|
|
||||||
float *supported_scales;
|
float *supported_scales;
|
||||||
int n_supported_scales;
|
int n_supported_scales;
|
||||||
@ -85,14 +83,12 @@ struct _MetaMonitorManagerXrandrClass
|
|||||||
|
|
||||||
G_DEFINE_TYPE (MetaMonitorManagerXrandr, meta_monitor_manager_xrandr, META_TYPE_MONITOR_MANAGER);
|
G_DEFINE_TYPE (MetaMonitorManagerXrandr, meta_monitor_manager_xrandr, META_TYPE_MONITOR_MANAGER);
|
||||||
|
|
||||||
#ifdef HAVE_XRANDR15
|
|
||||||
typedef struct _MetaMonitorXrandrData
|
typedef struct _MetaMonitorXrandrData
|
||||||
{
|
{
|
||||||
Atom xrandr_name;
|
Atom xrandr_name;
|
||||||
} MetaMonitorXrandrData;
|
} MetaMonitorXrandrData;
|
||||||
|
|
||||||
GQuark quark_meta_monitor_xrandr_data;
|
GQuark quark_meta_monitor_xrandr_data;
|
||||||
#endif /* HAVE_RANDR15 */
|
|
||||||
|
|
||||||
Display *
|
Display *
|
||||||
meta_monitor_manager_xrandr_get_xdisplay (MetaMonitorManagerXrandr *manager_xrandr)
|
meta_monitor_manager_xrandr_get_xdisplay (MetaMonitorManagerXrandr *manager_xrandr)
|
||||||
@ -669,7 +665,6 @@ meta_monitor_manager_xrandr_set_crtc_gamma (MetaMonitorManager *manager,
|
|||||||
XRRFreeGamma (gamma);
|
XRRFreeGamma (gamma);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XRANDR15
|
|
||||||
static MetaMonitorXrandrData *
|
static MetaMonitorXrandrData *
|
||||||
meta_monitor_xrandr_data_from_monitor (MetaMonitor *monitor)
|
meta_monitor_xrandr_data_from_monitor (MetaMonitor *monitor)
|
||||||
{
|
{
|
||||||
@ -830,7 +825,6 @@ meta_monitor_manager_xrandr_init_monitors (MetaMonitorManagerXrandr *manager_xra
|
|||||||
}
|
}
|
||||||
XRRFreeMonitors (m);
|
XRRFreeMonitors (m);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
meta_monitor_manager_xrandr_is_transform_handled (MetaMonitorManager *manager,
|
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;
|
manager_xrandr->has_randr15 = FALSE;
|
||||||
XRRQueryVersion (manager_xrandr->xdisplay, &major_version,
|
XRRQueryVersion (manager_xrandr->xdisplay, &major_version,
|
||||||
&minor_version);
|
&minor_version);
|
||||||
#ifdef HAVE_XRANDR15
|
|
||||||
if (major_version > 1 ||
|
if (major_version > 1 ||
|
||||||
(major_version == 1 &&
|
(major_version == 1 &&
|
||||||
minor_version >= 5))
|
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);
|
manager_xrandr->tiled_monitor_atoms = g_hash_table_new (NULL, NULL);
|
||||||
}
|
}
|
||||||
meta_monitor_manager_xrandr_init_monitors (manager_xrandr);
|
meta_monitor_manager_xrandr_init_monitors (manager_xrandr);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
G_OBJECT_CLASS (meta_monitor_manager_xrandr_parent_class)->constructed (object);
|
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->change_backlight = meta_monitor_manager_xrandr_change_backlight;
|
||||||
manager_class->get_crtc_gamma = meta_monitor_manager_xrandr_get_crtc_gamma;
|
manager_class->get_crtc_gamma = meta_monitor_manager_xrandr_get_crtc_gamma;
|
||||||
manager_class->set_crtc_gamma = meta_monitor_manager_xrandr_set_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_added = meta_monitor_manager_xrandr_tiled_monitor_added;
|
||||||
manager_class->tiled_monitor_removed = meta_monitor_manager_xrandr_tiled_monitor_removed;
|
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->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_monitor_mode_scale = meta_monitor_manager_xrandr_calculate_monitor_mode_scale;
|
||||||
manager_class->calculate_supported_scales = meta_monitor_manager_xrandr_calculate_supported_scales;
|
manager_class->calculate_supported_scales = meta_monitor_manager_xrandr_calculate_supported_scales;
|
||||||
|
@ -42,10 +42,6 @@
|
|||||||
#include <X11/extensions/Xdamage.h>
|
#include <X11/extensions/Xdamage.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
|
|
||||||
#ifdef HAVE_RANDR
|
|
||||||
#include <X11/extensions/Xrandr.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "backends/meta-cursor-sprite-xcursor.h"
|
#include "backends/meta-cursor-sprite-xcursor.h"
|
||||||
#include "backends/meta-cursor-tracker-private.h"
|
#include "backends/meta-cursor-tracker-private.h"
|
||||||
#include "backends/meta-idle-monitor-dbus.h"
|
#include "backends/meta-idle-monitor-dbus.h"
|
||||||
|
@ -118,11 +118,6 @@ static void prefs_changed_callback (MetaPreference pref,
|
|||||||
static void
|
static void
|
||||||
meta_print_compilation_info (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
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
||||||
meta_verbose ("Compiled with startup notification\n");
|
meta_verbose ("Compiled with startup notification\n");
|
||||||
#else
|
#else
|
||||||
|
@ -45,10 +45,7 @@
|
|||||||
#include <X11/extensions/Xdamage.h>
|
#include <X11/extensions/Xdamage.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
|
|
||||||
#ifdef HAVE_RANDR
|
|
||||||
#include <X11/extensions/Xrandr.h>
|
#include <X11/extensions/Xrandr.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "backends/meta-backend-private.h"
|
#include "backends/meta-backend-private.h"
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user