[PATCH] user32: Tell MENU_SuspendPopup which message to remove.

Alex Henrie alexhenrie24 at gmail.com
Mon Dec 5 22:28:50 CST 2016


Fixes https://bugs.winehq.org/show_bug.cgi?id=41508

This solution is probably what the original author of MENU_SuspendPopup
meant to add later.

Later on we can add an optimization for WM_SYSKEYDOWN parallel to the
optimization for WM_KEYDOWN in MENU_SuspendPopup; for now it's fine to
go through the slow branch.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/user32/menu.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 45ce7f5..c1dbe89 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -2878,7 +2878,7 @@ static BOOL MENU_KeyEscape(MTRACKER* pmt, UINT wFlags)
  *
  * Handle a VK_LEFT key event in a menu.
  */
-static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags )
+static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags, UINT16 uMsg )
 {
     POPUPMENU *menu;
     HMENU hmenutmp, hmenuprev;
@@ -2918,7 +2918,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, uMsg ) )
 		pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,
 						pmt->hTopMenu, TRUE, wFlags);
 	}
@@ -2931,7 +2931,7 @@ static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags )
  *
  * Handle a VK_RIGHT key event in a menu.
  */
-static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags )
+static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags, UINT16 uMsg )
 {
     HMENU hmenutmp;
     POPUPMENU *menu = MENU_GetMenu( pmt->hTopMenu );
@@ -2975,7 +2975,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, uMsg ) )
 		pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,
 						       pmt->hTopMenu, TRUE, wFlags);
     }
@@ -3178,11 +3178,11 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
 		    break;
 
 		case VK_LEFT:
-		    MENU_KeyLeft( &mt, wFlags );
+		    MENU_KeyLeft( &mt, wFlags, msg.message );
 		    break;
 
 		case VK_RIGHT:
-		    MENU_KeyRight( &mt, wFlags );
+		    MENU_KeyRight( &mt, wFlags, msg.message );
 		    break;
 
 		case VK_ESCAPE:
-- 
2.10.2




More information about the wine-patches mailing list