now added fix suggested by Ioannis to make menus work when an entryfunc
authorDiederick Niehorster <dcnieho@gmail.com>
Mon, 23 Jul 2012 09:51:34 +0000 (09:51 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Mon, 23 Jul 2012 09:51:34 +0000 (09:51 +0000)
is defined for the window

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

src/mswin/fg_main_mswin.c

index 663ff3b..7250b3a 100644 (file)
@@ -518,9 +518,11 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
     case WM_KILLFOCUS:
         {
             SFG_Menu* menu = NULL;
+            SFG_Window* saved_window = fgStructure.CurrentWindow;
 /*            printf("WM_KILLFOCUS: %p\n", window ); */
             lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
             INVOKE_WCB( *window, Entry, ( GLUT_LEFT ) );
+            fgSetWindow(saved_window);
 
             /* If we have an open menu, see if the open menu should be closed
              * when focus was lost because user either switched