From 530df550e4af63fce126001c5509d931d9ee65f9 Mon Sep 17 00:00:00 2001 From: attila Date: Sat, 19 Apr 2008 09:58:01 +0000 Subject: revert commits 26437-26439 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26468 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/x11_common.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 00ac963664..2ed8ff31c6 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -367,25 +367,28 @@ static void init_atoms(void) } void update_xinerama_info(void) { -#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; +#ifdef HAVE_XINERAMA 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; -- cgit v1.2.3