X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=freeglut-1.3%2Ffreeglut_gamemode.c;h=5b4eff306f70957e03364f126b5ee3710286c550;hb=4718a4ac2bad82816c5169dcdd16967d058d6810;hp=30c552c011b6303c588084119822e1349f9ceb77;hpb=325b6327a5df4c476789ac5a329031677f3ca59b;p=freeglut diff --git a/freeglut-1.3/freeglut_gamemode.c b/freeglut-1.3/freeglut_gamemode.c index 30c552c..5b4eff3 100644 --- a/freeglut-1.3/freeglut_gamemode.c +++ b/freeglut-1.3/freeglut_gamemode.c @@ -137,6 +137,15 @@ void fghRestoreState( void ) displayModes[ i ] ); + /* + * In case this will be the last X11 call we do before exit, + * we've to flush the X11 output queue to be sure the command + * is really brought onto it's way to the X server. + * The application should not do this because it + * would not be platform independent then. + */ + XFlush(fgDisplay.Display); + return; } } @@ -200,6 +209,8 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest ) if( fghCheckDisplayMode( displayModes[ i ]->hdisplay, displayModes[ i ]->vdisplay, fgState.GameModeDepth, fgState.GameModeRefresh ) ) { + if( haveToTest ) + return( TRUE ); /* * OKi, this is the display mode we have been looking for... */