clicking in another window also no longer closed the menu unless focus was changed...
[freeglut] / src / mswin / fg_menu_mswin.c
index d198cca..9df001e 100644 (file)
 #include "../fg_internal.h"
 
 
+
 GLvoid fgPlatformGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y )
 {
     *x = glutGet ( GLUT_SCREEN_WIDTH );
     *y = glutGet ( GLUT_SCREEN_HEIGHT );
 }
 
+void fgPlatformCheckMenuDeactivate()
+{
+    /* User/system switched application focus.
+     * If we have an open menu, close it.
+     */
+    SFG_Menu* menu = NULL;
+
+    if ( fgStructure.Menus.First )
+        menu = fgGetActiveMenu();
+
+    if ( menu )
+    {
+        printf("focus menu close\n");
+        fgDeactivateMenu(menu->ParentWindow);
+    }
+};
+
 
 
 /* -- PLATFORM-SPECIFIC INTERFACE FUNCTION -------------------------------------------------- */