comparison libvo/mga_common.c @ 8988:3b328492f94d

xinerama fix part 1 xmga only for the moment, have to work on xvidix.
author attila
date Sat, 18 Jan 2003 14:33:29 +0000
parents ff92d9b5ade5
children 8c3d54868366
comparison
equal deleted inserted replaced
8987:c83c18f58964 8988:3b328492f94d
6 6
7 // mga_vid drawing functions 7 // mga_vid drawing functions
8 static void set_window( void ); /* forward declaration to kill warnings */ 8 static void set_window( void ); /* forward declaration to kill warnings */
9 #ifdef VO_XMGA 9 #ifdef VO_XMGA
10 static void mDrawColorKey( void ); /* forward declaration to kill warnings */ 10 static void mDrawColorKey( void ); /* forward declaration to kill warnings */
11 #ifdef HAVE_XINERAMA
12 extern int xinerama_screen;
13 #endif
11 #endif 14 #endif
12 15
13 static int mga_next_frame=0; 16 static int mga_next_frame=0;
14 17
15 static mga_vid_config_t mga_vid_config; 18 static mga_vid_config_t mga_vid_config;
470 473
471 screens = XineramaQueryScreens(mDisplay,&num_screens); 474 screens = XineramaQueryScreens(mDisplay,&num_screens);
472 475
473 /* find the screen we are on */ 476 /* find the screen we are on */
474 i = 0; 477 i = 0;
475 while(!(screens[i].x_org <= drwcX && screens[i].y_org <= drwcY && 478 while(i<num_screens &&
476 screens[i].x_org + screens[i].width >= drwcX && 479 ((screens[i].x_org < drwcX) ||
477 screens[i].y_org + screens[i].height >= drwcY )) 480 (screens[i].y_org < drwcY) ||
481 (screens[i].x_org + screens[i].width >= drwcX) ||
482 (screens[i].y_org + screens[i].height >= drwcY)))
478 { 483 {
479 i++; 484 i++;
485 }
486
487 if(i<num_screens)
488 {
489 /* save the screen we are on */
490 xinerama_screen = i;
491 } else {
492 /* oops.. couldnt find the screen we are on
493 * because the upper left corner left the
494 * visual range. assume we are still on the
495 * same screen
496 */
497 i = xinerama_screen;
480 } 498 }
481 499
482 /* set drwcX and drwcY to the right values */ 500 /* set drwcX and drwcY to the right values */
483 drwcX = drwcX - screens[i].x_org; 501 drwcX = drwcX - screens[i].x_org;
484 drwcY = drwcY - screens[i].y_org; 502 drwcY = drwcY - screens[i].y_org;