comparison libvo/x11_common.c @ 26405:d557441dc9c5

Always calculate the xinerama screen mplayer is on. Bug reported by thomas.lindroth(<at>)gmail.com
author attila
date Sun, 13 Apr 2008 11:08:59 +0000
parents afa125da85cf
children 92037292fe2b
comparison
equal deleted inserted replaced
26404:d549dcb766df 26405:d557441dc9c5
366 XA_INIT(WM_DELETE_WINDOW); 366 XA_INIT(WM_DELETE_WINDOW);
367 } 367 }
368 368
369 void update_xinerama_info(void) { 369 void update_xinerama_info(void) {
370 int screen = xinerama_screen; 370 int screen = xinerama_screen;
371 // center coordinates of the window
372 int x = vo_dx + vo_dwidth / 2;
373 int y = vo_dy + vo_dheight / 2;
371 xinerama_x = xinerama_y = 0; 374 xinerama_x = xinerama_y = 0;
372 #ifdef HAVE_XINERAMA 375 #ifdef HAVE_XINERAMA
373 if (screen >= -1 && XineramaIsActive(mDisplay)) 376 if (screen >= -1 && XineramaIsActive(mDisplay))
374 { 377 {
375 XineramaScreenInfo *screens; 378 XineramaScreenInfo *screens;
376 int num_screens; 379 int num_screens;
377 380
378 screens = XineramaQueryScreens(mDisplay, &num_screens); 381 screens = XineramaQueryScreens(mDisplay, &num_screens);
379 if (screen >= num_screens)
380 screen = num_screens - 1;
381 if (screen == -1) {
382 int x = vo_dx + vo_dwidth / 2;
383 int y = vo_dy + vo_dheight / 2;
384 for (screen = num_screens - 1; screen > 0; screen--) { 382 for (screen = num_screens - 1; screen > 0; screen--) {
385 int left = screens[screen].x_org; 383 int left = screens[screen].x_org;
386 int right = left + screens[screen].width; 384 int right = left + screens[screen].width;
387 int top = screens[screen].y_org; 385 int top = screens[screen].y_org;
388 int bottom = top + screens[screen].height; 386 int bottom = top + screens[screen].height;
389 if (left <= x && x <= right && top <= y && y <= bottom) 387 if (left <= x && x <= right && top <= y && y <= bottom)
390 break; 388 break;
391 } 389 }
392 }
393 if (screen < 0) 390 if (screen < 0)
394 screen = 0; 391 screen = 0;
395 vo_screenwidth = screens[screen].width; 392 vo_screenwidth = screens[screen].width;
396 vo_screenheight = screens[screen].height; 393 vo_screenheight = screens[screen].height;
397 xinerama_x = screens[screen].x_org; 394 xinerama_x = screens[screen].x_org;