Index: libvo/x11_common.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v retrieving revision 1.113 diff -u -u -r1.113 x11_common.c --- libvo/x11_common.c 16 Nov 2002 16:08:36 -0000 1.113 +++ libvo/x11_common.c 18 Nov 2002 09:05:46 -0000 @@ -3,6 +3,7 @@ #include #include #include +#include #include "config.h" #include "mp_msg.h" @@ -147,6 +148,8 @@ unsigned long nitems, bytesafter; unsigned char * args = NULL; char * name = NULL; + Bool rval; + time_t stime; if ( WinID >= 0 ) return vo_wm_Unknown; @@ -166,9 +169,10 @@ XSelectInput( mDisplay,win,PropertyChangeMask | StructureNotifyMask ); XMapWindow( mDisplay,win ); XMoveWindow( mDisplay,win,vo_screenwidth,vo_screenheight ); + stime=time( NULL ); do { - XCheckWindowEvent( mDisplay,win,PropertyChangeMask | StructureNotifyMask,&xev ); + rval=XCheckWindowEvent( mDisplay,win,PropertyChangeMask | StructureNotifyMask,&xev ); if ( xev.type == PropertyNotify ) { @@ -179,7 +183,7 @@ if ( wm != vo_wm_Unknown ) break; XFree( name ); name=NULL; } - } while( c++ < 25 ); + } while( ( c+= rval ? 1 : 0 ) < 25 && time( NULL ) - stime < 4 ); if ( name ) XFree( name ); XUnmapWindow( mDisplay,win ); XDestroyWindow( mDisplay,win );