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

@ -54,12 +54,6 @@
#include <X11/cursorfont.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
#include <X11/extensions/Xrandr.h>
#endif

View File

@ -129,21 +129,6 @@ meta_print_compilation_info (void)
#else
meta_verbose ("Compiled without shape extension\n");
#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
meta_verbose ("Compiled with sync extension\n");
#else

View File

@ -41,12 +41,8 @@
#include <meta/compositor.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
#include <X11/extensions/Xrandr.h>
#endif
@ -478,7 +474,6 @@ reload_monitor_infos (MetaScreen *screen)
screen->monitor_infos[1].rect.width = screen->rect.width / 2;
}
#ifdef HAVE_XFREE_XINERAMA
if (screen->n_monitor_infos == 0 &&
XineramaIsActive (display->xdisplay))
{
@ -548,74 +543,10 @@ reload_monitor_infos (MetaScreen *screen)
else if (screen->n_monitor_infos > 0)
{
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);
}
#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
* we can use the field unconditionally
*/