+ * Deactivates a menu pointed by the function argument.
+ */
+static void fghDeactivateSubMenu( SFG_MenuEntry *menuEntry )
+{
+ SFG_MenuEntry *subMenuIter;
+ /* Hide the present menu's window */
+ fgSetWindow( menuEntry->SubMenu->Window );
+ glutHideWindow( );
+
+ /* Forget about having that menu active anymore, now: */
+ menuEntry->SubMenu->Window->ActiveMenu = NULL;
+ menuEntry->SubMenu->IsActive = GL_FALSE;
+ menuEntry->SubMenu->ActiveEntry = NULL;
+
+ /* Hide all submenu windows, and the root menu's window. */
+ for ( subMenuIter = (SFG_MenuEntry *)menuEntry->SubMenu->Entries.First;
+ subMenuIter;
+ subMenuIter = (SFG_MenuEntry *)subMenuIter->Node.Next )
+ {
+ subMenuIter->IsActive = GL_FALSE;
+
+ /* Is that an active submenu by any case? */
+ if( subMenuIter->SubMenu )
+ fghDeactivateSubMenu( subMenuIter );
+ }
+
+ fgSetWindow ( menuEntry->SubMenu->ParentWindow ) ;
+}
+
+/*
+ * Private function to get the virtual maximum screen extent
+ */
+static GLvoid fghGetVMaxExtent( SFG_Window* window, int* x, int* y )
+{
+ if( fgStructure.GameMode )
+ {
+#if TARGET_HOST_UNIX_X11
+ int wx, wy;
+ Window w;
+
+ XTranslateCoordinates(
+ fgDisplay.Display,
+ window->Window.Handle,
+ fgDisplay.RootWindow,
+ 0, 0, &wx, &wy, &w);
+
+ *x = fgState.GameModeSize.X + wx;
+ *y = fgState.GameModeSize.Y + wy;
+#else
+ *x = glutGet ( GLUT_SCREEN_WIDTH );
+ *y = glutGet ( GLUT_SCREEN_HEIGHT );
+#endif
+ }
+ else
+ {
+ *x = fgDisplay.ScreenWidth;
+ *y = fgDisplay.ScreenHeight;
+ }
+}
+
+/*