Commit 2abf2c7a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Make menu code cope with WM_SYSKEY*/WM_SYSCHAR messages.

Unblock menu loop if a window being destroyed owns a tracked menu.
parent 970b2218
......@@ -54,7 +54,7 @@ extern HWND ICONTITLE_Create( HWND hwnd );
/* menu controls */
extern BOOL MENU_Init(void);
extern BOOL MENU_IsMenuActive(void);
extern HWND MENU_IsMenuActive(void);
extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
INT orgX, INT orgY );
......
......@@ -2010,9 +2010,9 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
/**********************************************************************
* MENU_IsMenuActive
*/
BOOL MENU_IsMenuActive(void)
HWND MENU_IsMenuActive(void)
{
return (top_popup != 0);
return top_popup;
}
/***********************************************************************
......@@ -2690,8 +2690,13 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
switch(msg.message)
{
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
switch(msg.wParam)
{
case VK_MENU:
fEndMenu = TRUE;
break;
case VK_HOME:
case VK_END:
MENU_SelectItem( mt.hOwnerWnd, mt.hCurrentMenu,
......@@ -2744,17 +2749,8 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
}
break; /* WM_KEYDOWN */
case WM_SYSKEYDOWN:
switch(msg.wParam)
{
case VK_MENU:
fEndMenu = TRUE;
break;
}
break; /* WM_SYSKEYDOWN */
case WM_CHAR:
case WM_SYSCHAR:
{
UINT pos;
......
......@@ -1439,6 +1439,9 @@ BOOL WINAPI DestroyWindow( HWND hwnd )
if (HOOK_CallHooks( WH_CBT, HCBT_DESTROYWND, (WPARAM)hwnd, 0, TRUE )) return FALSE;
if (MENU_IsMenuActive() == hwnd)
EndMenu();
is_child = (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD) != 0;
if (is_child)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment