Make support for "XFree86" Xinerama mandatory

Require the headers for "XFree86" Xinerama to be present at compile
time. The older "Solaris" Xinerama is only needed for versions of
Solaris where Mutter is unlikely to work. Solaris 10 and 11 include
the XFree86 Xinerama libraries, and apparently that's the only version
that will actually work for Solaris 11, which uses Xorg.

https://bugzilla.gnome.org/show_bug.cgi?id=674727
This commit is contained in:
Owen W. Taylor 2012-04-24 15:18:46 -04:00
parent ed358c8f4b
commit 93037e4c6b
4 changed files with 21 additions and 142 deletions

View File

@ -212,60 +212,31 @@ AC_PATH_XTRA
ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
# Check for Xinerama extension (Solaris impl or Xfree impl) # Check for Xinerama extension - we only support the "XFree86" style,
# and not the older Solaris-only version; recent Solaris supports the
# XFree86 style.
mutter_save_cppflags="$CPPFLAGS" mutter_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_ARG_ENABLE(xinerama, have_xinerama=yes
AC_HELP_STRING([--disable-xinerama], AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
[disable mutter's use of the Xinerama extension]), [AC_CHECK_HEADER(X11/extensions/Xinerama.h,
try_xinerama=$enable_xinerama,try_xinerama=yes) [X_EXTRA_LIBS="-lXinerama $X_EXTRA_LIBS"
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
use_solaris_xinerama=no X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
use_xfree_xinerama=no fi],
if test "${try_xinerama}" != no; then have_xinerama=no,
case "$host" in [#include <X11/Xlib.h>])],
*-*-solaris*) have_xinerama=no, -lXext $ALL_X_LIBS)
# Check for solaris AC_MSG_CHECKING(for Xinerama support)
use_solaris_xinerama=yes AC_MSG_RESULT($have_xinerama)
AC_CHECK_LIB(Xext, XineramaGetInfo,
use_solaris_xinerama=yes, use_solaris_xinerama=no,
$ALL_X_LIBS)
if test "x$use_solaris_xinerama" = "xyes"; then
AC_CHECK_HEADER(X11/extensions/xinerama.h,
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
fi
AC_DEFINE(HAVE_SOLARIS_XINERAMA, , [Have Solaris-style Xinerama])
AC_DEFINE(HAVE_XINERAMA, , [Have some version of Xinerama]),
use_solaris_xinerama=no,
[#include <X11/Xlib.h>])
fi
AC_MSG_CHECKING(for Xinerama support on Solaris)
AC_MSG_RESULT($use_solaris_xinerama);
;;
*)
# Check for XFree
use_xfree_xinerama=yes
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
[AC_CHECK_HEADER(X11/extensions/Xinerama.h,
X_EXTRA_LIBS="-lXinerama $X_EXTRA_LIBS"
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
fi
AC_DEFINE(HAVE_XFREE_XINERAMA, , [Have XFree86-style Xinerama])
AC_DEFINE(HAVE_XINERAMA,, [Have some version of Xinerama]),
use_xfree_xinerama=no,
[#include <X11/Xlib.h>])],
use_xfree_xinerama=no, -lXext $ALL_X_LIBS)
AC_MSG_CHECKING(for Xinerama support on XFree86)
AC_MSG_RESULT($use_xfree_xinerama);
;;
esac
fi
CPPFLAGS="$mutter_save_cppflags" CPPFLAGS="$mutter_save_cppflags"
if test x$have_xinerama = xno; then
AC_MSG_ERROR([Xinerama extension was not found])
fi
SHAPE_LIBS= SHAPE_LIBS=
found_shape=no found_shape=no
AC_CHECK_LIB(Xext, XShapeQueryExtension, AC_CHECK_LIB(Xext, XShapeQueryExtension,
@ -496,8 +467,6 @@ mutter-$VERSION
source code location: ${srcdir} source code location: ${srcdir}
compiler: ${CC} compiler: ${CC}
XFree86 Xinerama: ${use_xfree_xinerama}
Solaris Xinerama: ${use_solaris_xinerama}
Startup notification: ${have_startup_notification} Startup notification: ${have_startup_notification}
libcanberra: ${have_libcanberra} libcanberra: ${have_libcanberra}
Introspection: ${found_introspection} Introspection: ${found_introspection}

View File

@ -54,12 +54,6 @@
#include <X11/cursorfont.h> #include <X11/cursorfont.h>
#include "mutter-enum-types.h" #include "mutter-enum-types.h"
#ifdef HAVE_SOLARIS_XINERAMA
#include <X11/extensions/xinerama.h>
#endif
#ifdef HAVE_XFREE_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
#ifdef HAVE_RANDR #ifdef HAVE_RANDR
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#endif #endif

View File

@ -129,21 +129,6 @@ meta_print_compilation_info (void)
#else #else
meta_verbose ("Compiled without shape extension\n"); meta_verbose ("Compiled without shape extension\n");
#endif #endif
#ifdef HAVE_XINERAMA
meta_topic (META_DEBUG_XINERAMA, "Compiled with Xinerama extension\n");
#else
meta_topic (META_DEBUG_XINERAMA, "Compiled without Xinerama extension\n");
#endif
#ifdef HAVE_XFREE_XINERAMA
meta_topic (META_DEBUG_XINERAMA, " (using XFree86 Xinerama)\n");
#else
meta_topic (META_DEBUG_XINERAMA, " (not using XFree86 Xinerama)\n");
#endif
#ifdef HAVE_SOLARIS_XINERAMA
meta_topic (META_DEBUG_XINERAMA, " (using Solaris Xinerama)\n");
#else
meta_topic (META_DEBUG_XINERAMA, " (not using Solaris Xinerama)\n");
#endif
#ifdef HAVE_XSYNC #ifdef HAVE_XSYNC
meta_verbose ("Compiled with sync extension\n"); meta_verbose ("Compiled with sync extension\n");
#else #else

View File

@ -41,12 +41,8 @@
#include <meta/compositor.h> #include <meta/compositor.h>
#include "mutter-enum-types.h" #include "mutter-enum-types.h"
#ifdef HAVE_SOLARIS_XINERAMA
#include <X11/extensions/xinerama.h>
#endif
#ifdef HAVE_XFREE_XINERAMA
#include <X11/extensions/Xinerama.h> #include <X11/extensions/Xinerama.h>
#endif
#ifdef HAVE_RANDR #ifdef HAVE_RANDR
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#endif #endif
@ -478,7 +474,6 @@ reload_monitor_infos (MetaScreen *screen)
screen->monitor_infos[1].rect.width = screen->rect.width / 2; screen->monitor_infos[1].rect.width = screen->rect.width / 2;
} }
#ifdef HAVE_XFREE_XINERAMA
if (screen->n_monitor_infos == 0 && if (screen->n_monitor_infos == 0 &&
XineramaIsActive (display->xdisplay)) XineramaIsActive (display->xdisplay))
{ {
@ -548,73 +543,9 @@ reload_monitor_infos (MetaScreen *screen)
else if (screen->n_monitor_infos > 0) else if (screen->n_monitor_infos > 0)
{ {
meta_topic (META_DEBUG_XINERAMA, meta_topic (META_DEBUG_XINERAMA,
"No XFree86 Xinerama extension or XFree86 Xinerama inactive on display %s\n", "No Xinerama extension or Xinerama inactive on display %s\n",
display->name); display->name);
} }
#else
meta_topic (META_DEBUG_XINERAMA,
"Mutter compiled without XFree86 Xinerama support\n");
#endif /* HAVE_XFREE_XINERAMA */
#ifdef HAVE_SOLARIS_XINERAMA
/* This code from GDK, Copyright (C) 2002 Sun Microsystems */
if (screen->n_monitor_infos == 0 &&
XineramaGetState (screen->display->xdisplay,
screen->number))
{
XRectangle monitors[MAXFRAMEBUFFERS];
unsigned char hints[16];
int result;
int n_monitors;
int i;
n_monitors = 0;
result = XineramaGetInfo (screen->display->xdisplay,
screen->number,
monitors, hints,
&n_monitors);
/* Yes I know it should be Success but the current implementation
* returns the num of monitor
*/
if (result > 0)
{
g_assert (n_monitors > 0);
screen->monitor_infos = g_new0 (MetaMonitorInfo, n_monitors);
screen->n_monitor_infos = n_monitors;
i = 0;
while (i < n_monitors)
{
screen->monitor_infos[i].number = i;
screen->monitor_infos[i].rect.x = monitors[i].x;
screen->monitor_infos[i].rect.y = monitors[i].y;
screen->monitor_infos[i].rect.width = monitors[i].width;
screen->monitor_infos[i].rect.height = monitors[i].height;
meta_topic (META_DEBUG_XINERAMA,
"Monitor %d is %d,%d %d x %d\n",
screen->monitor_infos[i].number,
screen->monitor_infos[i].rect.x,
screen->monitor_infos[i].rect.y,
screen->monitor_infos[i].rect.width,
screen->monitor_infos[i].rect.height);
++i;
}
}
}
else if (screen->n_monitor_infos == 0)
{
meta_topic (META_DEBUG_XINERAMA,
"No Solaris Xinerama extension or Solaris Xinerama inactive on display %s\n",
display->name);
}
#else
meta_topic (META_DEBUG_XINERAMA,
"Mutter compiled without Solaris Xinerama support\n");
#endif /* HAVE_SOLARIS_XINERAMA */
/* If no Xinerama, fill in the single screen info so /* If no Xinerama, fill in the single screen info so
* we can use the field unconditionally * we can use the field unconditionally