Index: x11_common.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v retrieving revision 1.118 diff -u -u -r1.118 x11_common.c --- x11_common.c 14 Dec 2002 11:14:37 -0000 1.118 +++ x11_common.c 17 Dec 2002 17:22:35 -0000 @@ -3,6 +3,7 @@ #include #include #include +#include #include "config.h" #include "mp_msg.h" @@ -148,6 +149,8 @@ unsigned long nitems, bytesafter; unsigned char * args = NULL; char * name = NULL; + Bool rval; + time_t stime; if ( WinID >= 0 ) return vo_wm_Unknown; @@ -167,9 +170,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 ) { @@ -180,7 +184,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 );