From 4ea88b1262b05dada58e8a3407239e5b5b39d48b Mon Sep 17 00:00:00 2001 From: cjp Date: Sun, 23 Mar 2003 16:21:14 +0000 Subject: [PATCH] Applied patch to fix GameMode issues supplied by Bernhard Kaindl. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@55 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/freeglut-1.3/freeglut_gamemode.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/freeglut/freeglut/freeglut-1.3/freeglut_gamemode.c b/freeglut/freeglut/freeglut-1.3/freeglut_gamemode.c index 30c552c..5b4eff3 100644 --- a/freeglut/freeglut/freeglut-1.3/freeglut_gamemode.c +++ b/freeglut/freeglut/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... */