X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=inline;f=src%2Fmswin%2Ffg_menu_mswin.c;h=93c538ef6501e36bb4310f4967474b431f529978;hb=39de8f8682808d020ebc7eb7f13fe49bdc07406a;hp=9c3e952c399a856bda19998cfe00b44f09596e68;hpb=814bb8a2509c767bf0a58b26f106b9e90254d2ff;p=freeglut diff --git a/src/mswin/fg_menu_mswin.c b/src/mswin/fg_menu_mswin.c index 9c3e952..93c538e 100644 --- a/src/mswin/fg_menu_mswin.c +++ b/src/mswin/fg_menu_mswin.c @@ -37,18 +37,25 @@ GLvoid fgPlatformGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y ) *y = glutGet ( GLUT_SCREEN_HEIGHT ); } -void fgPlatformCheckMenuDeactivate() +void fgPlatformCheckMenuDeactivate(HWND newFocusWnd) { /* User/system switched application focus. * If we have an open menu, close it. */ SFG_Menu* menu = NULL; - if ( fgStructure.Menus.First ) + if ( fgState.ActiveMenus ) menu = fgGetActiveMenu(); if ( menu ) - fgDeactivateMenu(menu->ParentWindow); + { + if (newFocusWnd != menu->Window->Window.Handle) + /* When in GameMode, the menu's parent window will lose focus when the menu is opened. + * This is sadly necessary as we need to do an activating ShowWindow() for the menu + * to pop up over the gamemode window + */ + fgDeactivateMenu(menu->ParentWindow); + } };