diff options
author | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-06 21:07:20 +0000 |
---|---|---|
committer | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-06 21:07:20 +0000 |
commit | eb2c656b52c6cf903cb0f2e8d69aab7ea424f50b (patch) | |
tree | d97ce2816e6dc9cbc7687edbb4867c8711e14d0d /libvo | |
parent | 280cb5acaf6b8d66519aa78cd9c6e69952dc3e6f (diff) |
Xinerama patch number two by attila.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4018 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vo_gl.c | 3 | ||||
-rw-r--r-- | libvo/vo_gl2.c | 3 | ||||
-rw-r--r-- | libvo/vo_x11.c | 3 | ||||
-rw-r--r-- | libvo/vo_xmga.c | 29 | ||||
-rw-r--r-- | libvo/x11_common.c | 25 |
5 files changed, 52 insertions, 11 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 2ea0bb920c..b19779a93b 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -181,6 +181,9 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 /* Map window. */ XMapWindow(mDisplay, mywindow); +#ifdef HAVE_XINERAMA + vo_x11_xinerama_move(mDisplay,mywindow); +#endif /* Wait for map. */ do diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index b52ff7ed52..424d20bc1d 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -691,6 +691,9 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 /* Map window. */ XMapWindow(mDisplay, mywindow); +#ifdef HAVE_XINERAMA + vo_x11_xinerama_move(mDisplay,mywindow); +#endif XClearWindow(mDisplay,mywindow); /* Wait for map. */ diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 96ec7c2d41..266614f35f 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -298,6 +298,9 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d XSelectInput( mDisplay,mywindow,StructureNotifyMask ); XSetStandardProperties( mDisplay,mywindow,hello,hello,None,NULL,0,&hint ); XMapWindow( mDisplay,mywindow ); +#ifdef HAVE_XINERAMA + vo_x11_xinerama_move(mDisplay,mywindow); +#endif do { XNextEvent( mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != mywindow ); XSelectInput( mDisplay,mywindow,NoEventMask ); diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c index e2c6b7784a..5494f683d6 100644 --- a/libvo/vo_xmga.c +++ b/libvo/vo_xmga.c @@ -45,6 +45,10 @@ LIBVO_EXTERN( xmga ) #include <X11/Xutil.h> #include <errno.h> +#ifdef HAVE_XINERAMA +#include <X11/extensions/Xinerama.h> +#endif + #include "x11_common.h" #include "sub.h" #include "aspect.h" @@ -139,6 +143,31 @@ static void set_window(){ mDrawColorKey(); +#ifdef HAVE_XINERAMA + if(XineramaIsActive(mDisplay)) + { + XineramaScreenInfo *screens; + int num_screens; + 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; diff --git a/libvo/x11_common.c b/libvo/x11_common.c index ea530e60b9..8290e442ab 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -48,6 +48,12 @@ int mLocalDisplay; /* 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; @@ -149,13 +155,15 @@ int vo_init( void ) XineramaScreenInfo *screens; int num_screens; - mScreen = 0; - screens = XineramaQueryScreens(mDisplay, &num_screens); + if(xinerama_screen >= num_screens) xinerama_screen = 0; if (! vo_screenwidth) - vo_screenwidth=screens[mScreen].width; + vo_screenwidth=screens[xinerama_screen].width; if (! vo_screenheight) - vo_screenheight=screens[mScreen].height; + vo_screenheight=screens[xinerama_screen].height; + xinerama_x = screens[xinerama_screen].x_org; + xinerama_y = screens[xinerama_screen].y_org; + XFree(screens); } else @@ -482,15 +490,10 @@ void saver_off(Display *mDisplay) { #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); + /* printf("XXXX Xinerama screen: x: %hd y: %hd\n",xinerama_x,xinerama_y); */ + XMoveWindow(dsp,w,xinerama_x,xinerama_y); } } #endif |