changeset 8991:04bd618db347

xinerama fix part 1 - count your paranthesis xvidix should now work too
author attila
date Sat, 18 Jan 2003 15:05:06 +0000
parents 923bb0d3df5f
children a2111e523d50
files libvo/vo_xvidix.c
diffstat 1 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xvidix.c	Sat Jan 18 14:57:44 2003 +0000
+++ b/libvo/vo_xvidix.c	Sat Jan 18 15:05:06 2003 +0000
@@ -76,6 +76,10 @@
 
 extern void set_video_eq( int cap );
 
+#ifdef HAVE_XINERAMA
+extern int xinerama_screen;
+#endif
+
 static void set_window(int force_update)
 {
     Window mRoot;
@@ -127,10 +131,26 @@
 	screens = XineramaQueryScreens(mDisplay, &num_screens);
 	
 	/* find the screen we are on */
-	while ((screens[i].x_org <= drwcX) || (screens[i].y_org <= 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++;
+		(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 */
 	drwcX = drwcX - screens[i].x_org;