diff -Naur main/libvo/vo_xmga.c xinerama/libvo/vo_xmga.c --- main/libvo/vo_xmga.c Fri Dec 28 21:15:43 2001 +++ xinerama/libvo/vo_xmga.c Tue Jan 1 16:08:54 2002 @@ -45,6 +45,11 @@ #include #include +#ifdef HAVE_XINERAMA +#include +#endif + + #include "x11_common.h" #include "sub.h" #include "aspect.h" @@ -138,7 +143,34 @@ } mDrawColorKey(); - +#ifdef HAVE_XINERAMA + if(XineramaIsActive(mDisplay)) + { + XineramaScreenInfo *screens; + int num_screens; + int wx,wy,wh,ww,dep,border; + Window root; + int i; + + /* where are we */ + XGetGeometry(mDisplay,mWindow,&root,&wx,&wy,&ww,&wh,&border,&dep); + /* get xinerama info */ + screens = XineramaQueryScreens(mDisplay,&num_screens); + + /* find the screen we are on */ + i = 0; + while(!(screens[i].x_org <= wx && screens[i].y_org <= wy && + screens[i].x_org + screens[i].width >= wx && + screens[i].y_org + screens[i].height >= wy )) + { + i++; + } + + /* set wndX and wndY to the right values */ + drwcX = wx - screens[i].x_org; + drwcY = wy - screens[i].y_org; + } +#endif mga_vid_config.x_org=drwcX; mga_vid_config.y_org=drwcY; mga_vid_config.dest_width=drwWidth; diff -Naur main/libvo/vo_xv.c xinerama/libvo/vo_xv.c --- main/libvo/vo_xv.c Fri Dec 28 14:24:27 2001 +++ xinerama/libvo/vo_xv.c Mon Dec 31 18:17:09 2001 @@ -205,6 +205,9 @@ XSetStandardProperties(mDisplay, mywindow, hello, hello, None, NULL, 0, &hint); if ( mFullscreen ) vo_x11_decoration( mDisplay,mywindow,0 ); XMapWindow(mDisplay, mywindow); +#ifdef HAVE_XINERAMA + vo_x11_xinerama_move(mDisplay,mywindow); +#endif mygc = XCreateGC(mDisplay, mywindow, 0L, &xgcv); XFlush(mDisplay); XSync(mDisplay, False); diff -Naur main/libvo/x11_common.c xinerama/libvo/x11_common.c --- main/libvo/x11_common.c Fri Dec 28 14:24:27 2001 +++ xinerama/libvo/x11_common.c Mon Dec 31 19:45:37 2001 @@ -146,15 +146,15 @@ { XineramaScreenInfo *screens; int num_screens; - int disp_screen = mScreen; + + mScreen = 0; screens = XineramaQueryScreens(mDisplay, &num_screens); - if (disp_screen > num_screens) - disp_screen = 0; if (! vo_screenwidth) - vo_screenwidth=screens[disp_screen].width; + vo_screenwidth=screens[mScreen].width; if (! vo_screenheight) - vo_screenheight=screens[disp_screen].height; + vo_screenheight=screens[mScreen].height; + XFree(screens); } else #endif @@ -474,5 +474,23 @@ XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); // turning off screensaver } + + + +#ifdef HAVE_XINERAMA +void vo_x11_xinerama_move(Display *dsp, Window w) +{ + XineramaScreenInfo *screens; + int num_screens; + + if(XineramaIsActive(dsp)) + { + screens = XineramaQueryScreens(dsp,&num_screens); + /* printf("XXXX Xinerama screen: x: %hd y: %hd\n",screens[mScreen].x_org,screens[mScreen].y_org); */ + XMoveWindow(dsp,w,screens[mScreen].x_org,screens[mScreen].y_org); + XFree(screens); + } +} +#endif #endif diff -Naur main/libvo/x11_common.h xinerama/libvo/x11_common.h --- main/libvo/x11_common.h Fri Dec 28 14:24:27 2001 +++ xinerama/libvo/x11_common.h Mon Dec 31 18:15:58 2001 @@ -37,3 +37,7 @@ void saver_off( Display * ); void saver_on( Display * ); + +#ifdef HAVE_XINERAMA +void vo_x11_xinerama_move(Display *dsp, Window w); +#endif