From 6636a18df676a102cee0bcf31ce81b67dc7b7ac2 Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Sat, 6 Apr 2013 10:16:27 +0000 Subject: [PATCH] now that menu's no longer take focus from their parent, clicking the non-client area of the parent no longer closed the menu. fixed. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1609 7f0cb862-5218-0410-a997-914c9d46530a --- src/mswin/fg_main_mswin.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c index f1c6eb7..3128c2e 100644 --- a/src/mswin/fg_main_mswin.c +++ b/src/mswin/fg_main_mswin.c @@ -983,6 +983,20 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); break; + case WM_NCLBUTTONDOWN: + case WM_NCMBUTTONDOWN: + case WM_NCRBUTTONDOWN: + { + SFG_Menu *menu; + if (fgStructure.Menus.First && (menu = fgGetActiveMenu())) + /* user clicked non-client area of window while a menu is open. Close menu */ + fgDeactivateMenu(menu->ParentWindow); + + /* and always pass to DefWindowProc */ + lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); + } + break; + #if 0 case WM_ACTIVATE: /* printf("WM_ACTIVATE: %x (ID: %i) %d %d\n",lParam, window->ID, HIWORD(wParam), LOWORD(wParam)); */ -- 1.7.10.4