mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 10:28:19 +00:00
Make menu code cope with WM_SYSKEY*/WM_SYSCHAR messages.
Unblock menu loop if a window being destroyed owns a tracked menu.
This commit is contained in:
parent
970b2218d6
commit
2abf2c7aa5
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue