Implementing feature request "[ 947118 ] Popup menu is hidden under the TOPMOST window"
authorJohn F. Fay <johnffay@nettally.com>
Tue, 18 Sep 2007 03:50:24 +0000 (03:50 +0000)
committerJohn F. Fay <johnffay@nettally.com>
Tue, 18 Sep 2007 03:50:24 +0000 (03:50 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@720 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_window.c

index 7236c91..91d4a71 100644 (file)
@@ -727,6 +727,14 @@ void fgOpenWindow( SFG_Window* window, const char* title,
     if( !( window->Window.Handle ) )
         fgError( "Failed to create a window (%s)!", title );
 
+    /* Make a menu window always on top - fix Feature Request 947118 */
+    if( window->IsMenu || gameMode )
+        SetWindowPos(
+                        window->Window.Handle,
+                        HWND_TOPMOST,
+                        0, 0, 0, 0,
+                        SWP_NOMOVE | SWP_NOSIZE
+                    );
 #if defined(_WIN32_WCE)
     ShowWindow( window->Window.Handle, SW_SHOW );
 #else