changeset 2149:6358db6ad3d0

Xinerama screen size fix by Lev Babiev <harley@hosers.org>
author arpi
date Wed, 10 Oct 2001 01:48:54 +0000
parents 0c6cef85d507
children 93e0ed86705e
files configure libvo/x11_common.c
diffstat 2 files changed, 40 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Wed Oct 10 01:07:50 2001 +0000
+++ b/configure	Wed Oct 10 01:48:54 2001 +0000
@@ -150,6 +150,7 @@
 				if both /dev/mga_vid and x11 are available]
         --enable-xv             build with Xv render support for X 4.x [autodetect]
 	--enable-vm		build with XF86VidMode support for x11 driver
+	--enable-xinerama	build with Xinerama support for x11 driver [autodetect]
         --enable-x11            build with X11 render support [autodetect]
 	--enable-fbdev		build with FBDev render support [_not_ autodetected]
 	--enable-mlib		build with MLIB support ( only Solaris )
@@ -502,6 +503,7 @@
 _ggi=no
 _xv=no
 _vm=no
+_xinerama=no
 _xdpms_3=no
 _xdpms_4=no
 _3dfx=no
@@ -534,6 +536,7 @@
 _ggilib=
 _xvlib=
 _x11lib=
+_xineramalib=
 
 _select='#define HAVE_AUDIO_SELECT'
 
@@ -890,6 +893,7 @@
 nm `echo $_x11libdir|cut -c 3-`/libXext.a | grep DPMSQueryExtension > /dev/null 2>&1 && _xdpms_4=yes
 $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXv $_socklib > /dev/null 2>&1 && _xv=yes
 $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXxf86vm $_socklib > /dev/null 2>&1 && _vm=yes
+$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXinerama $_socklib > /dev/null 2>&1 && _xinerama=yes
 
 # this is not yet checked with OpenBSD - atmos
 if [ "$system_name" = "FreeBSD" -o "$system_name" = "OpenBSD" ]; then
@@ -1197,6 +1201,9 @@
   --enable-vm)
         _vm=yes
         ;;
+  --enable-xinerama)
+        _xinerama=yes
+        ;;
   --enable-3dfx)
         _3dfx=yes
         ;;
@@ -1301,6 +1308,9 @@
   --disable-vm)
         _vm=no
         ;;
+  --disable-xinerama)
+        _xinerama=no
+        ;;
   --disable-mlib)
 	_mlib=no
 	;;
@@ -1557,6 +1567,7 @@
 echo "Checking for GGI ... $_ggi"
 echo "Checking for OpenGL ... $_gl"
 echo "Checking for Xv ... $_xv"
+echo "Checking for Xinerama ... $_xinerama"
 echo "Checking for X11 ... $_x11"
 echo "Checking for DGA ... $_dga"
 echo "Checking for DGA 2.0 .. $_dga2"
@@ -1787,6 +1798,10 @@
   _xvlib='-lXv'
 fi
 
+if [ $_xinerama = yes ]; then
+  _xvlib='-lXinerama'
+fi
+
 if [ $_sdl = yes ]; then
   _sdllib=`$_sdlconfig --libs` 
   _sdlcflags=`$_sdlconfig --cflags` 
@@ -2058,6 +2073,12 @@
  _vm='#undef HAVE_XF86VM'
 fi
 
+if [ $_xinerama = yes ]; then
+ _xinerama='#define HAVE_XINERAMA'
+else
+ _xinerama='#undef HAVE_XINERAMA'
+fi
+
 # ---
 
 if [ $_mga = yes ]; then
@@ -2170,7 +2191,7 @@
 
 X11_INC=$_x11incdir
 X11DIR=$_x11libdir
-X_LIBS=$_x11libdir $_extralibdir $_gllib $_ggilib $_sdllib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib $_aalib $_libvorbis
+X_LIBS=$_x11libdir $_extralibdir $_gllib $_ggilib $_sdllib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib $_aalib $_libvorbis $_libxinerama
 
 TERMCAP_LIB=$_libtermcap
 XMM_LIBS = $_xmmplibs
@@ -2399,6 +2420,7 @@
 $_x11
 $_xv
 $_vm
+$_xinerama
 $_gl
 $_dga
 $_dga2
--- a/libvo/x11_common.c	Wed Oct 10 01:07:50 2001 +0000
+++ b/libvo/x11_common.c	Wed Oct 10 01:48:54 2001 +0000
@@ -21,6 +21,9 @@
 #include <X11/extensions/dpms.h>
 #endif
 
+#ifdef HAVE_XINERAMA
+#include <X11/extensions/Xinerama.h>
+#endif
 
 /*
  * If SCAN_VISUALS is defined, vo_init() scans all available TrueColor
@@ -135,9 +138,22 @@
   }
  mScreen=DefaultScreen( mDisplay );     // Screen ID.
  mRootWin=RootWindow( mDisplay,mScreen );// Root window ID.
+
+#ifdef HAVE_XINERAMA
+ if(XineramaIsActive(mDisplay))
+  {
+  XineramaScreenInfo *screens;
+  int num_screens;
+  screens = XineramaQueryScreens(mDisplay, &num_screens);
+  vo_screenwidth=screens[0].width;
+  vo_screenheight=screens[0].height;
+  }
+ else
+#endif
+ {
  vo_screenwidth=DisplayWidth( mDisplay,mScreen );
  vo_screenheight=DisplayHeight( mDisplay,mScreen );
-
+ }
  // get color depth (from root window, or the best visual):
  XGetWindowAttributes(mDisplay, mRootWin, &attribs);
  depth=attribs.depth;