From: Alex Henrie Subject: [PATCH 1/2] user32: Remove redundant parameter from MENU_SuspendPopup. Message-Id: <20161103020205.25809-1-alexhenrie24@gmail.com> Date: Wed, 2 Nov 2016 20:01:34 -0600 This function was written in 1997, and as far as I can tell, it has always only accepted WM_KEYDOWN. Signed-off-by: Alex Henrie --- dlls/user32/menu.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 45ce7f5..1398d38 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -2806,31 +2806,26 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk, UINT wFlags ) * The idea is not to show the popup if the next input message is * going to hide it anyway. */ -static BOOL MENU_SuspendPopup( MTRACKER* pmt, UINT16 uMsg ) +static BOOL MENU_SuspendPopup( MTRACKER* pmt ) { MSG msg; msg.hwnd = pmt->hOwnerWnd; - PeekMessageW( &msg, 0, uMsg, uMsg, PM_NOYIELD | PM_REMOVE); + PeekMessageW( &msg, 0, WM_KEYDOWN, WM_KEYDOWN, PM_NOYIELD | PM_REMOVE ); pmt->trackFlags |= TF_SKIPREMOVE; - switch( uMsg ) + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE ); + if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) { - case WM_KEYDOWN: - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) - { - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE); - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYDOWN && - (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT)) - { - pmt->trackFlags |= TF_SUSPENDPOPUP; - return TRUE; - } - } - break; + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE ); + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE ); + if( msg.message == WM_KEYDOWN && + (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT) ) + { + pmt->trackFlags |= TF_SUSPENDPOPUP; + return TRUE; + } } /* failures go through this */ @@ -2918,7 +2913,7 @@ static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags ) /* A sublevel menu was displayed - display the next one * unless there is another displacement coming up */ - if( !MENU_SuspendPopup( pmt, WM_KEYDOWN ) ) + if( !MENU_SuspendPopup( pmt ) ) pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, pmt->hTopMenu, TRUE, wFlags); } @@ -2975,7 +2970,7 @@ static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags ) MENU_MoveSelection( pmt->hOwnerWnd, pmt->hTopMenu, ITEM_NEXT ); if( hmenutmp || pmt->trackFlags & TF_SUSPENDPOPUP ) - if( !MENU_SuspendPopup(pmt, WM_KEYDOWN) ) + if( !MENU_SuspendPopup( pmt ) ) pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, pmt->hTopMenu, TRUE, wFlags); } -- 2.10.2