diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 6106c7a469..96ec7c2d41 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -71,9 +71,6 @@ static XImage *myximage; static int depth,bpp,mode; static XWindowAttributes attribs; -/* output window id */ -int WinID=0; - //static int vo_dwidth,vo_dheight; static int Flip_Flag; @@ -284,8 +281,8 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d } #endif - if ( WinID ){ - mywindow = (Window)WinID; + if ( WinID>=0 ){ + mywindow = WinID ? ((Window)WinID) : RootWindow( mDisplay,mScreen ); XUnmapWindow( mDisplay,mywindow ); XChangeWindowAttributes( mDisplay,mywindow,xswamask,&xswa ); } diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index 14db960f8a..bd89773236 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -188,9 +188,16 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t xswa.border_pixel = 0; xswamask = CWBackPixel | CWBorderPixel; + if ( WinID>=0 ){ + mywindow = WinID ? ((Window)WinID) : RootWindow(mDisplay,mScreen); + XUnmapWindow( mDisplay,mywindow ); + XChangeWindowAttributes( mDisplay,mywindow,xswamask,&xswa ); + } else + mywindow = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen), - hint.x, hint.y, hint.width, hint.height, - 0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa); + hint.x, hint.y, hint.width, hint.height, + 0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa); + vo_x11_classhint( mDisplay,mywindow,"xv" ); vo_hidecursor(mDisplay,mywindow); diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 393cfa4af6..6c871aa268 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -45,6 +45,8 @@ Window mRootWin; int mScreen; int mLocalDisplay; +/* output window id */ +int WinID=-1; void vo_hidecursor ( Display *disp , Window win ) { diff --git a/libvo/x11_common.h b/libvo/x11_common.h index d20d2ffe92..d8266d9679 100644 --- a/libvo/x11_common.h +++ b/libvo/x11_common.h @@ -12,6 +12,7 @@ extern Display *mDisplay; extern Window mRootWin; extern int mScreen; extern int mLocalDisplay; +extern int WinID; int vo_init( void ); int vo_hidecursor ( Display* , Window );