When having submenu open in one window and activating its root menu in
authorDiederick Niehorster <dcnieho@gmail.com>
Sat, 21 Jul 2012 02:32:58 +0000 (02:32 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Sat, 21 Jul 2012 02:32:58 +0000 (02:32 +0000)
another window, submenu didn't close and root menu's activate state
wasn't reset. Fixed.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1351 7f0cb862-5218-0410-a997-914c9d46530a

src/fg_menu.c

index 0e219b8..2460b1d 100644 (file)
@@ -512,9 +512,9 @@ static void fghActivateMenu( SFG_Window* window, int button )
     SFG_Menu* menu = window->Menu[ button ];
     SFG_Window* current_window = fgStructure.CurrentWindow;
 
-    /* If the menu is already active in another window, deactivate it there */
+    /* If the menu is already active in another window, deactivate it (and any submenu's) there */
     if ( menu->ParentWindow )
-      menu->ParentWindow->ActiveMenu = NULL ;
+      fgDeactivateMenu(menu->ParentWindow);
 
     /* Mark the menu as active, so that it gets displayed: */
     window->ActiveMenu = menu;