X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=inline;f=src%2Ffreeglut_window.c;fp=src%2Ffreeglut_window.c;h=7d50a9d0f64225a1b8092b97ffe0ce1dff34e05e;hb=b6817e508c50718ac93da48d14ac2ba7092ed954;hp=41c3fe76ab7507aec45adf7b46ede0ee1768a024;hpb=b8b35ac5a8b91f64b23ebed6c58a63e042f9870f;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 41c3fe7..7d50a9d 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -1332,10 +1332,11 @@ void fgOpenWindow( SFG_Window* window, const char* title, */ void fgCloseWindow( SFG_Window* window ) { - /* if we're in gamemode, call glutLeaveGameMode first to make sure the - * gamemode is properly closed before closing the window + /* if we're in gamemode and we're closing the gamemode window, + * call glutLeaveGameMode first to make sure the gamemode is + * properly closed before closing the window */ - if (fgStructure.GameModeWindow != NULL) + if (fgStructure.GameModeWindow != NULL && fgStructure.GameModeWindow->ID==window->ID) glutLeaveGameMode(); #if TARGET_HOST_POSIX_X11