Index: libvo/vo_x11.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v retrieving revision 1.132 diff -u -r1.132 vo_x11.c --- libvo/vo_x11.c 1 Jun 2003 21:59:28 -0000 1.132 +++ libvo/vo_x11.c 9 Aug 2003 14:12:42 -0000 @@ -318,6 +318,8 @@ XUnmapWindow( mDisplay,vo_window ); XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xswa ); vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask ); + vo_spawnwindow=XCreateWindow(mDisplay,mRootWin, 0,0,vo_screenwidth,vo_screenheight,0,0,0,0,0,0); + wid_fs_valid=1; XMapWindow( mDisplay,vo_window ); } else XSelectInput( mDisplay,vo_window,ExposureMask ); } Index: libvo/vo_xv.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v retrieving revision 1.143 diff -u -r1.143 vo_xv.c --- libvo/vo_xv.c 1 Jul 2003 21:37:20 -0000 1.143 +++ libvo/vo_xv.c 9 Aug 2003 14:12:44 -0000 @@ -229,6 +229,8 @@ XUnmapWindow( mDisplay,vo_window ); XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xswa ); vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask ); + vo_spawnwindow=XCreateWindow(mDisplay,mRootWin, 0,0,vo_screenwidth,vo_screenheight,0,0,0,0,0,0); + wid_fs_valid=1; XMapWindow( mDisplay,vo_window ); } else { drwX=vo_dx; drwY=vo_dy; } } else Index: libvo/x11_common.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v retrieving revision 1.147 diff -u -r1.147 x11_common.c --- libvo/x11_common.c 1 Jul 2003 21:37:20 -0000 1.147 +++ libvo/x11_common.c 9 Aug 2003 14:12:47 -0000 @@ -594,9 +594,13 @@ } Window vo_window = None; +Window vo_spawnwindow = None; +Window vo_backupwindow = None; GC vo_gc = NULL; XSizeHints vo_hint; +int wid_fs_valid = 0; + #ifdef HAVE_NEW_GUI void vo_setwindow( Window w,GC g ) { vo_window=w; vo_gc=g; @@ -625,8 +629,13 @@ XUnmapWindow( mDisplay,vo_window ); XDestroyWindow(mDisplay, vo_window); do { XNextEvent( mDisplay,&xev ); } while ( xev.type != DestroyNotify || xev.xdestroywindow.event != vo_window ); + } else { + XUnmapWindow(mDisplay,vo_spawnwindow); + XDestroyWindow(mDisplay,vo_spawnwindow); } + vo_window=None; + } vo_fs=0; vo_old_width=vo_old_height=0; @@ -878,26 +887,53 @@ void vo_x11_fullscreen( void ) { int x,y,w,h; - - if ( WinID >= 0 ) return; - + if ( WinID>=0 && !wid_fs_valid ) return; + if ( vo_fs ){ - // fs->win - if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return; - vo_fs=VO_FALSE; - x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height; + // fullscreen -> window + if(WinID>=0){ + XUnmapWindow(mDisplay,vo_window); + vo_window=vo_backupwindow; + XMapWindow(mDisplay,vo_window); + vo_old_x=0; + vo_old_y=0; + vo_fs=VO_FALSE; + x=0; y=0; w=vo_old_width; h=vo_old_height; + vo_dheight=vo_old_height; + vo_dwidth=vo_old_width; + XSelectInput(mDisplay,vo_window,ExposureMask|KeyPressMask|PointerMotionMask); + } else { + if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return; + vo_fs=VO_FALSE; + x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height; + } + } else { - // win->fs - if(vo_old_width && - (vo_dwidth==vo_screenwidth && vo_dwidth!=vo_old_width) && - (vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return; - vo_fs=VO_TRUE; - vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight; - x=0; y=0; w=vo_screenwidth; h=vo_screenheight; + // window -> fullscreen + if(WinID >= 0){ + vo_backupwindow=vo_window; + vo_window=vo_spawnwindow; + XSelectInput(mDisplay, vo_window, ExposureMask|KeyPressMask|PointerMotionMask); + //ButtonPressMask|KeyPressMask|PointerMotionMask|ButtonReleaseMask); + vo_fs=VO_TRUE; + vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight; + x=0; y=0; w=vo_screenwidth; h=vo_screenheight; + vo_dheight=vo_screenheight; + vo_dwidth=vo_screenwidth; + } else { + if(vo_old_width && + (vo_dwidth==vo_screenwidth && vo_dwidth!=vo_old_width) && + (vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return; + vo_fs=VO_TRUE; + vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight; + x=0; y=0; w=vo_screenwidth; h=vo_screenheight; + } } vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 0 : 1 ); - vo_x11_sizehint( x,y,w,h,0 ); - vo_x11_setlayer( mDisplay,vo_window,vo_fs ); + if(WinID<0){ + vo_x11_sizehint( x,y,w,h,0 ); + vo_x11_setlayer( mDisplay,vo_window,vo_fs ); + } if(vo_wm_type==0 && !(vo_fsmode&16)) // XUnmapWindow( mDisplay,vo_window ); // required for MWM XWithdrawWindow(mDisplay,vo_window,mScreen); Index: libvo/x11_common.h =================================================================== RCS file: /cvsroot/mplayer/main/libvo/x11_common.h,v retrieving revision 1.31 diff -u -r1.31 x11_common.h --- libvo/x11_common.h 1 Jul 2003 21:37:20 -0000 1.31 +++ libvo/x11_common.h 9 Aug 2003 14:12:47 -0000 @@ -34,7 +34,7 @@ extern int mScreen; extern int mLocalDisplay; extern int WinID; - +extern int wid_fs_valid; extern int vo_mouse_timer_const; extern int vo_mouse_autohide; @@ -58,6 +58,7 @@ #endif extern Window vo_window; +extern Window vo_spawnwindow; extern GC vo_gc; extern XSizeHints vo_hint;