changeset 3990:87538547c8f4

xinerama fix by attila
author atmos4
date Sat, 05 Jan 2002 08:49:46 +0000
parents 8d60da7c4ac6
children dcc632dd2097
files libvo/vo_xmga.c libvo/vo_xv.c libvo/x11_common.c libvo/x11_common.h
diffstat 4 files changed, 33 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xmga.c	Sat Jan 05 01:33:39 2002 +0000
+++ b/libvo/vo_xmga.c	Sat Jan 05 08:49:46 2002 +0000
@@ -305,6 +305,9 @@
    XSetNormalHints( mDisplay,mWindow,&hint );
    XStoreName( mDisplay,mWindow,mTitle );
    XMapWindow( mDisplay,mWindow );
+#ifdef HAVE_XINERAMA
+   vo_x11_xinerama_move(mDisplay,mWindow);
+#endif
    mGC=XCreateGC( mDisplay,mWindow,GCForeground,&wGCV );
 #ifdef HAVE_NEW_GUI
   }
--- a/libvo/vo_xv.c	Sat Jan 05 01:33:39 2002 +0000
+++ b/libvo/vo_xv.c	Sat Jan 05 08:49:46 2002 +0000
@@ -205,6 +205,9 @@
    XSetStandardProperties(mDisplay, mywindow, hello, hello, None, NULL, 0, &hint);
    if ( mFullscreen ) vo_x11_decoration( mDisplay,mywindow,0 );
    XMapWindow(mDisplay, mywindow);
+#ifdef HAVE_XINERAMA
+   vo_x11_xinerama_move(mDisplay,mywindow);
+#endif
    mygc = XCreateGC(mDisplay, mywindow, 0L, &xgcv);
    XFlush(mDisplay);
    XSync(mDisplay, False);
--- a/libvo/x11_common.c	Sat Jan 05 01:33:39 2002 +0000
+++ b/libvo/x11_common.c	Sat Jan 05 08:49:46 2002 +0000
@@ -148,15 +148,15 @@
   {
   XineramaScreenInfo *screens;
   int num_screens;
-  int disp_screen = mScreen;
+
+  mScreen = 0;
 
   screens = XineramaQueryScreens(mDisplay, &num_screens);
-  if (disp_screen > num_screens)
-    disp_screen = 0;
   if (! vo_screenwidth)
-    vo_screenwidth=screens[disp_screen].width;
+    vo_screenwidth=screens[mScreen].width;
   if (! vo_screenheight)
-    vo_screenheight=screens[disp_screen].height;
+    vo_screenheight=screens[mScreen].height;
+  XFree(screens);
   }
  else
 #endif
@@ -477,4 +477,22 @@
 		    // turning off screensaver
 }
 
+
+
+#ifdef HAVE_XINERAMA
+void vo_x11_xinerama_move(Display *dsp, Window w)
+{
+	XineramaScreenInfo *screens;
+	int num_screens;
+
+	if(XineramaIsActive(dsp))
+	{
+		screens = XineramaQueryScreens(dsp,&num_screens);
+		/* printf("XXXX Xinerama screen: x: %hd y: %hd\n",screens[mScreen].x_org,screens[mScreen].y_org); */
+		XMoveWindow(dsp,w,screens[mScreen].x_org,screens[mScreen].y_org);
+		XFree(screens);
+	}
+}
 #endif
+
+#endif
--- a/libvo/x11_common.h	Sat Jan 05 01:33:39 2002 +0000
+++ b/libvo/x11_common.h	Sat Jan 05 08:49:46 2002 +0000
@@ -37,3 +37,7 @@
 
 void saver_off( Display * );
 void saver_on( Display * );
+
+#ifdef HAVE_XINERAMA
+void vo_x11_xinerama_move(Display *dsp, Window w);
+#endif