[Mplayer-cvslog] CVS: main/libvo mga_common.c,1.50,1.51

Attila Kinali CVS attila at mplayerhq.hu
Sat Jan 18 15:33:32 CET 2003


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

Modified Files:
	mga_common.c 
Log Message:
xinerama fix part 1
xmga only for the moment, have to work on xvidix.


Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- mga_common.c	4 Jan 2003 19:17:37 -0000	1.50
+++ mga_common.c	18 Jan 2003 14:33:29 -0000	1.51
@@ -8,6 +8,9 @@
 static void set_window( void );		/* forward declaration to kill warnings */
 #ifdef VO_XMGA
 static void mDrawColorKey( void );	/* forward declaration to kill warnings */
+#ifdef HAVE_XINERAMA
+extern int xinerama_screen;
+#endif
 #endif
 
 static int mga_next_frame=0;
@@ -472,11 +475,26 @@
 
 		 	/* 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 ))
+		 	while(i<num_screens &&
+		 	    ((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++;
+		 	}
+
+			if(i<num_screens)
+			{
+				/* save the screen we are on */
+				xinerama_screen = i;
+			} else {
+				/* oops.. couldnt find the screen we are on
+				 * because the upper left corner left the
+				 * visual range. assume we are still on the
+				 * same screen
+				 */
+				i = xinerama_screen;
 		 	}
 
 		 	/* set drwcX and drwcY to the right values */



More information about the MPlayer-cvslog mailing list