diff options
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/sub.c | 2 | ||||
-rw-r--r-- | libvo/vo_x11.c | 21 | ||||
-rw-r--r-- | libvo/vo_xmga.c | 45 | ||||
-rw-r--r-- | libvo/vo_xv.c | 13 |
4 files changed, 49 insertions, 32 deletions
diff --git a/libvo/sub.c b/libvo/sub.c index c9ee16d6e0..ff3a784605 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -163,7 +163,7 @@ inline static void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,in t=vo_sub->text[i++]; len=strlen(t)-1; - printf("sub(%d) '%s'\n",len,t); +// printf("sub(%d) '%s'\n",len,t); // if(len<0) memy -=h; // according to max of vo_font->pic_a[font]->h // else for (j=0;j<=len;j++){ diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index c728485038..7ad2218acb 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -375,13 +375,11 @@ printf( "w: %d h: %d\n\n",vo_dwidth,vo_dheight ); #ifdef HAVE_NEW_GUI if ( vo_window == None ) #endif - XSelectInput( mDisplay,mywindow,StructureNotifyMask | KeyPressMask ); - + { + XSelectInput( mDisplay,mywindow,StructureNotifyMask | KeyPressMask ); + saver_off(mDisplay); + } X_already_started++; - -// vo_initthread( mThread ); - - saver_off(mDisplay); return 0; } @@ -553,9 +551,16 @@ static uint32_t query_format( uint32_t format ) static void uninit(void) { -saver_on(mDisplay); // screen saver back on +#ifdef HAVE_NEW_GUI + if ( vo_window == None ) +#endif + saver_on(mDisplay); // screen saver back on #ifdef HAVE_XF86VM + #ifdef HAVE_NEW_GUI + if ((vidmodes!=NULL)&&( vo_window == None ) ) + #else if (vidmodes!=NULL) + #endif { int screen; screen=DefaultScreen( mDisplay ); XF86VidModeSwitchToMode(mDisplay,screen,vidmodes[0]); @@ -563,7 +568,7 @@ saver_on(mDisplay); // screen saver back on free(vidmodes); } #endif - + XClearWindow( mDisplay,mywindow ); printf("vo: uninit!\n"); } diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c index e6dae93142..d5c3d98cff 100644 --- a/libvo/vo_xmga.c +++ b/libvo/vo_xmga.c @@ -104,17 +104,12 @@ static void mDrawColorKey( void ) static void set_window(){ - XGetGeometry( mDisplay,mWindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth ); - drwX=0; drwY=0; // drwWidth=wndWidth; drwHeight=wndHeight; - XTranslateCoordinates( mDisplay,mWindow,mRoot,0,0,&drwcX,&drwcY,&mRoot ); - fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); - #ifdef HAVE_NEW_GUI if ( vo_window != None ) { mFullscreen=0; dwidth=mdwidth; dheight=mdheight; - if ( ( drwWidth == vo_screenwidth )&&( drwHeight == vo_screenheight ) ) + if ( ( vo_dwidth == vo_screenwidth )&&( vo_dheight == vo_screenheight ) ) { mFullscreen=1; dwidth=vo_screenwidth; @@ -123,6 +118,11 @@ static void set_window(){ } #endif + XGetGeometry( mDisplay,mWindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth ); + drwX=0; drwY=0; // drwWidth=wndWidth; drwHeight=wndHeight; + XTranslateCoordinates( mDisplay,mWindow,mRoot,0,0,&drwcX,&drwcY,&mRoot ); + fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); + if ( mFullscreen ) { drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; @@ -131,7 +131,7 @@ static void set_window(){ drwcY+=drwY; drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); - //fprintf( stderr,"[xmga-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); + fprintf( stderr,"[xmga-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); } mDrawColorKey(); @@ -235,7 +235,8 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_ wndWidth=d_width; wndHeight=d_height; dwidth=d_width; dheight=d_height; #ifdef HAVE_NEW_GUI - mdwidth=d_width; mdheight=d_height; +// mdwidth=d_width; mdheight=d_height; + mdwidth=width; mdheight=height; #endif mFullscreen=fullscreen&1; @@ -294,13 +295,13 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_ else { mWindow=vo_window; - fprintf( stderr,"[xmga] width: %d height: %d d_width: %d d_height: %d\n",width,height,d_width,d_height ); - if ( vo_screenwidth != d_width ) - { - XMoveWindow( mDisplay,mWindow,( vo_screenwidth - d_width ) / 2,( vo_screenheight - d_height ) / 2 ); - XResizeWindow( mDisplay,mWindow,d_width,d_height ); - } - else mFullscreen=1; +// fprintf( stderr,"[xmga] width: %d height: %d d_width: %d d_height: %d\n",width,height,d_width,d_height ); +// if ( vo_screenwidth != d_width ) +// { +// XMoveWindow( mDisplay,mWindow,( vo_screenwidth - d_width ) / 2,( vo_screenheight - d_height ) / 2 ); +// XResizeWindow( mDisplay,mWindow,d_width,d_height ); +// } +// else mFullscreen=1; mGC=vo_gc; //XCreateGC( mDisplay,mWindow,GCForeground,&wGCV ); } #endif @@ -316,6 +317,8 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_ mga_vid_config.colkey_blue=255; if(mga_init()) return -1; + + set_window(); #ifdef HAVE_NEW_GUI if ( vo_window == None ) @@ -324,7 +327,11 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_ XFlush( mDisplay ); XSync( mDisplay,False ); } - saver_off(mDisplay); + +#ifdef HAVE_NEW_GUI + if ( vo_window == None ) +#endif + saver_off(mDisplay); return 0; } @@ -336,7 +343,11 @@ static const vo_info_t* get_info( void ) static void uninit(void) { - saver_on(mDisplay); +#ifdef HAVE_NEW_GUI + if ( vo_window == None ) +#endif + saver_on(mDisplay); mga_uninit(); + XClearWindow( mDisplay,mWindow ); printf("vo: uninit!\n"); } diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index c7dc6c0e38..a50958cbf3 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -475,14 +475,15 @@ static uint32_t query_format(uint32_t format) */ } -static void uninit(void) { -int i; +static void uninit(void) +{ + int i; #ifdef HAVE_NEW_GUI - if ( vo_window == None ) + if ( vo_window == None ) #endif - saver_on(mDisplay); // screen saver back on -for( i=0;i<num_buffers;i++ ) - deallocate_xvimage( i ); + saver_on(mDisplay); // screen saver back on + for( i=0;i<num_buffers;i++ ) deallocate_xvimage( i ); + XClearWindow( mDisplay,mywindow ); } |