diff -Naur main/cfg-mplayer.h xinerama/cfg-mplayer.h --- main/cfg-mplayer.h Fri Dec 28 14:28:06 2001 +++ xinerama/cfg-mplayer.h Fri Jan 4 11:50:30 2002 @@ -73,6 +73,10 @@ extern int use_old_pp; #endif +#ifdef HAVE_XINERAMA +extern int xinerama_screen; +#endif + /* from libvo/aspect.c */ extern float monitor_aspect; @@ -259,6 +263,10 @@ #ifdef HAVE_X11 {"wid", &WinID, CONF_TYPE_INT, 0, 0, 0}, {"rootwin", &WinID, CONF_TYPE_FLAG, 0, -1, 0}, +#endif + +#ifdef HAVE_XINERAMA + {"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32}, #endif #define MAIN_CONF 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 Fri Jan 4 12:02:13 2002 @@ -45,6 +45,10 @@ #include #include +#ifdef HAVE_XINERAMA +#include +#endif + #include "x11_common.h" #include "sub.h" #include "aspect.h" @@ -138,7 +142,32 @@ } mDrawColorKey(); - +#ifdef HAVE_XINERAMA + if(XineramaIsActive(mDisplay)) + { + XineramaScreenInfo *screens; + int num_screens; + //int wx,wy,wh,ww,dep,border; + Window root; + int i; + + screens = XineramaQueryScreens(mDisplay,&num_screens); + + /* find the screen we are on */ + i = 0; + while(!(screens[i].x_org <= drwcX && screens[i].y_org <= drwcY && + screens[i].x_org + screens[i].width >= drwcX && + screens[i].y_org + screens[i].height >= drwcY )) + { + i++; + } + + /* set drwcX and drwcY to the right values */ + drwcX = drwcX - screens[i].x_org; + drwcY = drwcY - screens[i].y_org; + XFree(screens); + } +#endif mga_vid_config.x_org=drwcX; mga_vid_config.y_org=drwcY; mga_vid_config.dest_width=drwWidth; @@ -305,6 +334,9 @@ XSetNormalHints( mDisplay,mWindow,&hint ); XStoreName( mDisplay,mWindow,mTitle ); XMapWindow( mDisplay,mWindow ); +#ifdef HAVE_XINERAMA + vo_x11_xinerama_move(mDisplay,mWindow); +#endif mGC=XCreateGC( mDisplay,mWindow,GCForeground,&wGCV ); #ifdef HAVE_NEW_GUI } 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 Fri Jan 4 11:48:12 2002 @@ -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 Thu Jan 3 11:25:41 2002 +++ xinerama/libvo/x11_common.c Fri Jan 4 11:52:45 2002 @@ -48,6 +48,12 @@ /* output window id */ int WinID=-1; +#ifdef HAVE_XINERAMA +int xinerama_screen = 0; +int xinerama_x = 0; +int xinerama_y = 0; +#endif + void vo_hidecursor ( Display *disp , Window win ) { Cursor no_ptr; @@ -148,15 +154,17 @@ { XineramaScreenInfo *screens; int num_screens; - int disp_screen = mScreen; screens = XineramaQueryScreens(mDisplay, &num_screens); - if (disp_screen > num_screens) - disp_screen = 0; + if(xinerama_screen >= num_screens) xinerama_screen = 0; if (! vo_screenwidth) - vo_screenwidth=screens[disp_screen].width; + vo_screenwidth=screens[xinerama_screen].width; if (! vo_screenheight) - vo_screenheight=screens[disp_screen].height; + vo_screenheight=screens[xinerama_screen].height; + xinerama_x = screens[xinerama_screen].x_org; + xinerama_y = screens[xinerama_screen].y_org; + + XFree(screens); } else #endif @@ -476,5 +484,18 @@ XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); // turning off screensaver } + + + +#ifdef HAVE_XINERAMA +void vo_x11_xinerama_move(Display *dsp, Window w) +{ + if(XineramaIsActive(dsp)) + { + /* printf("XXXX Xinerama screen: x: %hd y: %hd\n",xinerama_x,xinerama_y); */ + XMoveWindow(dsp,w,xinerama_x,xinerama_y); + } +} +#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 Fri Jan 4 11:48:12 2002 @@ -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