diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-08 16:41:44 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-08 16:41:44 +0000 |
commit | 1bff6e8bc37081ef8a76c944726219c2cb53413e (patch) | |
tree | fdab40e6729842f22940f100536e94f251808c4c /libvo | |
parent | 8a99b7a507c9cd01127ec5c18970a1e27327517f (diff) | |
download | mpv-1bff6e8bc37081ef8a76c944726219c2cb53413e.tar.bz2 mpv-1bff6e8bc37081ef8a76c944726219c2cb53413e.tar.xz |
some bugfix, x[11|mga|v] ( fullscreen with more files )
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6014 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vo_x11.c | 35 | ||||
-rw-r--r-- | libvo/x11_common.c | 13 | ||||
-rw-r--r-- | libvo/x11_common.h | 15 |
3 files changed, 41 insertions, 22 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 0ed6d0616f..2a346e4da7 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -45,6 +45,11 @@ LIBVO_EXTERN( x11 ) #include "../mp_msg.h" +#ifdef HAVE_NEW_GUI +#include "../Gui/interface.h" +#include "../mplayer.h" +#endif + static vo_info_t vo_info = { "X11 ( XImage/Shm )", @@ -91,6 +96,9 @@ static int srcW=-1; static int srcH=-1; static int aspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing +static int old_vo_dwidth=-1; +static int old_vo_dheight=-1; + static void check_events(){ int ret = vo_x11_check_events(mDisplay); @@ -243,6 +251,9 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t vo_mouse_autohide=1; + old_vo_dwidth=-1; + old_vo_dheight=-1; + if (!title) title = strdup("MPlayer X11 (XImage/Shm) render"); @@ -260,7 +271,7 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t //printf( "w: %d h: %d\n\n",vo_dwidth,vo_dheight ); - XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs ); + XGetWindowAttributes( mDisplay,mRootWin,&attribs ); depth=attribs.depth; if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24; @@ -275,18 +286,19 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t aspect= ((1<<16)*d_width + d_height/2)/d_height; #ifdef HAVE_NEW_GUI - if ( vo_window == None ) + if(use_gui) guiGetEvent( guiSetShVideo,0 ); // the GUI will set up / resize the window + else #endif { hint.x=0; hint.y=0; - if(zoomFlag){ - hint.width=d_width; - hint.height=d_height; - }else{ - hint.width=width; - hint.height=height; - } +// if(zoomFlag){ +// hint.width=d_width; +// hint.height=d_height; +// }else{ +// hint.width=width; +// hint.height=height; +// } #ifdef HAVE_XF86VM if ( vm ) @@ -468,8 +480,6 @@ static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y { uint8_t *dst[3]; int dstStride[3]; - static int old_vo_dwidth=-1; - static int old_vo_dheight=-1; if((old_vo_dwidth != vo_dwidth || old_vo_dheight != vo_dheight) /*&& y==0*/ && zoomFlag) { @@ -602,6 +612,7 @@ uninit(void) vo_vm_close(mDisplay); #endif + zoomFlag=0; vo_x11_uninit(mDisplay, vo_window); freeSwsContext(swsContext); @@ -616,7 +627,7 @@ static uint32_t preinit(const char *arg) } #ifdef HAVE_NEW_GUI - if ( vo_window == None ) + if ( !use_gui ) #endif if( !vo_init() ) return -1; // Can't open X11 diff --git a/libvo/x11_common.c b/libvo/x11_common.c index c6eb590331..d5cb3bfa7d 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -37,6 +37,7 @@ #ifdef HAVE_NEW_GUI #include "../Gui/interface.h" +#include "../mplayer.h" #endif /* @@ -355,6 +356,12 @@ int vo_init( void ) return 1; } +void vo_uninit( void ) +{ + printf("vo: uninit ...\n" ); + if( !vo_depthonscreen ) return; + XCloseDisplay( mDisplay ); +} #include "../linux/keycodes.h" #include "wskeys.h" @@ -507,14 +514,14 @@ int vo_x11_uninit(Display *display, Window window) #ifdef HAVE_NEW_GUI /* destroy window only if it's not controlled by GUI */ - if (vo_window == None) + if ( !use_gui ) #endif { /* and -wid is set */ if (!(WinID > 0)) XDestroyWindow(display, window); - XCloseDisplay(display); vo_depthonscreen = 0; + vo_fs=0; } return(1); } @@ -721,7 +728,7 @@ void vo_x11_fullscreen( void ) // vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 ); break; case vo_wm_Unknown: - vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 ); +// vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 ); XUnmapWindow( mDisplay,vo_window ); break; case vo_wm_IceWM: diff --git a/libvo/x11_common.h b/libvo/x11_common.h index 06c3bc54b7..1aa37b3317 100644 --- a/libvo/x11_common.h +++ b/libvo/x11_common.h @@ -25,14 +25,15 @@ extern int WinID; extern int vo_mouse_timer_const; extern int vo_mouse_autohide; -int vo_init( void ); -int vo_hidecursor ( Display* , Window ); +extern int vo_init( void ); +extern void vo_uninit( void ); +extern int vo_hidecursor ( Display* , Window ); extern void vo_showcursor( Display *disp, Window win ); -void vo_x11_decoration( Display * vo_Display,Window w,int d ); -void vo_x11_classhint( Display * display,Window window,char *name ); -void vo_x11_sizehint( int x, int y, int width, int height, int max ); -int vo_x11_check_events(Display *mydisplay); -void vo_x11_fullscreen( void ); +extern void vo_x11_decoration( Display * vo_Display,Window w,int d ); +extern void vo_x11_classhint( Display * display,Window window,char *name ); +extern void vo_x11_sizehint( int x, int y, int width, int height, int max ); +extern int vo_x11_check_events(Display *mydisplay); +extern void vo_x11_fullscreen( void ); #endif extern Window vo_window; |