summaryrefslogtreecommitdiffstats
path: root/libvo/x11_common.c
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-19 09:58:01 +0000
committerattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-19 09:58:01 +0000
commit530df550e4af63fce126001c5509d931d9ee65f9 (patch)
tree42c5b3686253e6b7bd674e199785a9a9a9fec269 /libvo/x11_common.c
parent7c76c4a6f658921bbc533527c002b497dd2072e3 (diff)
downloadmpv-530df550e4af63fce126001c5509d931d9ee65f9.tar.bz2
mpv-530df550e4af63fce126001c5509d931d9ee65f9.tar.xz
revert commits 26437-26439
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26468 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r--libvo/x11_common.c25
1 files 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;