[Mplayer-cvslog] CVS: main/libvo vo_gl.c,1.15,1.16 vo_gl2.c,1.9,1.10 vo_x11.c,1.45,1.46 vo_xmga.c,1.37,1.38 x11_common.c,1.41,1.42

Atmosfear atmos4 at mplayer.dev.hu
Sun Jan 6 22:07:22 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv29288/libvo

Modified Files:
	vo_gl.c vo_gl2.c vo_x11.c vo_xmga.c x11_common.c 
Log Message:
Xinerama patch number two by attila.


Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- vo_gl.c	6 Nov 2001 11:21:08 -0000	1.15
+++ vo_gl.c	6 Jan 2002 21:07:20 -0000	1.16
@@ -181,6 +181,9 @@
 	/* Map window. */
 
 	XMapWindow(mDisplay, mywindow);
+#ifdef HAVE_XINERAMA
+	vo_x11_xinerama_move(mDisplay,mywindow);
+#endif
 
 	/* Wait for map. */
 	do 

Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vo_gl2.c	17 Dec 2001 17:15:16 -0000	1.9
+++ vo_gl2.c	6 Jan 2002 21:07:20 -0000	1.10
@@ -691,6 +691,9 @@
 	/* Map window. */
 
 	XMapWindow(mDisplay, mywindow);
+#ifdef HAVE_XINERAMA
+	vo_x11_xinerama_move(mDisplay,mywindow);
+#endif
         XClearWindow(mDisplay,mywindow);
 
 	/* Wait for map. */

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- vo_x11.c	28 Dec 2001 13:24:27 -0000	1.45
+++ vo_x11.c	6 Jan 2002 21:07:20 -0000	1.46
@@ -298,6 +298,9 @@
     XSelectInput( mDisplay,mywindow,StructureNotifyMask );
     XSetStandardProperties( mDisplay,mywindow,hello,hello,None,NULL,0,&hint );
     XMapWindow( mDisplay,mywindow );
+#ifdef HAVE_XINERAMA
+   vo_x11_xinerama_move(mDisplay,mywindow);
+#endif
     do { XNextEvent( mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != mywindow );
     XSelectInput( mDisplay,mywindow,NoEventMask );
 

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- vo_xmga.c	5 Jan 2002 08:49:46 -0000	1.37
+++ vo_xmga.c	6 Jan 2002 21:07:20 -0000	1.38
@@ -45,6 +45,10 @@
 #include <X11/Xutil.h>
 #include <errno.h>
 
+#ifdef HAVE_XINERAMA
+#include <X11/extensions/Xinerama.h>
+#endif
+
 #include "x11_common.h"
 #include "sub.h"
 #include "aspect.h"
@@ -139,6 +143,31 @@
 
          mDrawColorKey();
 
+#ifdef HAVE_XINERAMA
+		 if(XineramaIsActive(mDisplay))
+		 {
+		 	XineramaScreenInfo *screens;
+		 	int num_screens;
+		 	int i;
+
+		 	screens = XineramaQueryScreens(mDisplay,&num_screens);
+
+		 	/* find the screen we are on */
+		 	i = 0;
+		 	while(!(screens[i].x_org <= drwcX && screens[i].y_org <= drwcY &&
+		 	       screens[i].x_org + screens[i].width >= drwcX &&
+		 	       screens[i].y_org + screens[i].height >= drwcY ))
+		 	{
+		 		i++;
+		 	}
+
+		 	/* set drwcX and drwcY to the right values */
+		 	drwcX = drwcX - screens[i].x_org;
+		 	drwcY = drwcY - screens[i].y_org;
+		 	XFree(screens);
+		 }
+
+#endif
          mga_vid_config.x_org=drwcX;
          mga_vid_config.y_org=drwcY;
          mga_vid_config.dest_width=drwWidth;

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- x11_common.c	5 Jan 2002 08:49:46 -0000	1.41
+++ x11_common.c	6 Jan 2002 21:07:20 -0000	1.42
@@ -48,6 +48,12 @@
 /* output window id */
 int WinID=-1;
 
+#ifdef HAVE_XINERAMA
+int xinerama_screen = 0;
+int xinerama_x = 0;
+int xinerama_y = 0;
+#endif
+
 void vo_hidecursor ( Display *disp , Window win )
 {
 	Cursor no_ptr;
@@ -149,13 +155,15 @@
   XineramaScreenInfo *screens;
   int num_screens;
 
-  mScreen = 0;
-
   screens = XineramaQueryScreens(mDisplay, &num_screens);
+  if(xinerama_screen >= num_screens) xinerama_screen = 0;
   if (! vo_screenwidth)
-    vo_screenwidth=screens[mScreen].width;
+    vo_screenwidth=screens[xinerama_screen].width;
   if (! vo_screenheight)
-    vo_screenheight=screens[mScreen].height;
+    vo_screenheight=screens[xinerama_screen].height;
+  xinerama_x = screens[xinerama_screen].x_org;
+  xinerama_y = screens[xinerama_screen].y_org;
+
   XFree(screens);
   }
  else
@@ -482,15 +490,10 @@
 #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);
+		 /* printf("XXXX Xinerama screen: x: %hd y: %hd\n",xinerama_x,xinerama_y); */
+		XMoveWindow(dsp,w,xinerama_x,xinerama_y);
 	}
 }
 #endif




More information about the MPlayer-cvslog mailing list