changeset 26436:075cc328702b

revert commits 26437-26439
author attila
date Sat, 19 Apr 2008 09:58:01 +0000
parents a11857fab9ff
children 2735c113ed62
files libvo/x11_common.c
diffstat 1 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/x11_common.c	Sat Apr 19 09:53:42 2008 +0000
+++ b/libvo/x11_common.c	Sat Apr 19 09:58:01 2008 +0000
@@ -367,25 +367,28 @@
 }
 
 void update_xinerama_info(void) {
+    int screen = xinerama_screen;
+    xinerama_x = xinerama_y = 0;
 #ifdef HAVE_XINERAMA
-    int screen = xinerama_screen;
-    // center coordinates of the window
-    int x = vo_dx + vo_dwidth / 2;
-    int y = vo_dy + vo_dheight / 2;
-    xinerama_x = xinerama_y = 0;
     if (screen >= -1 && XineramaIsActive(mDisplay))
     {
         XineramaScreenInfo *screens;
         int num_screens;
 
         screens = XineramaQueryScreens(mDisplay, &num_screens);
-        for (screen = num_screens - 1; screen > 0; screen--) {
-           int left = screens[screen].x_org;
-           int right = left + screens[screen].width;
-           int top = screens[screen].y_org;
-           int bottom = top + screens[screen].height;
-           if (left <= x && x <= right && top <= y && y <= bottom)
-               break;
+        if (screen >= num_screens)
+            screen = num_screens - 1;
+        if (screen == -1) {
+            int x = vo_dx + vo_dwidth / 2;
+            int y = vo_dy + vo_dheight / 2;
+            for (screen = num_screens - 1; screen > 0; screen--) {
+               int left = screens[screen].x_org;
+               int right = left + screens[screen].width;
+               int top = screens[screen].y_org;
+               int bottom = top + screens[screen].height;
+               if (left <= x && x <= right && top <= y && y <= bottom)
+                   break;
+            }
         }
         if (screen < 0)
             screen = 0;