[PATCH v3] user32: Don't send WM_CHAR when a menu gets VK_ESCAPE and add tests

Alexandre Julliard julliard at winehq.org
Wed Feb 1 12:13:47 CST 2017


Fabian Maurer <dark.shadow4 at web.de> writes:

> diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
> index 59fcd9c488..a4d59713c9 100644
> --- a/dlls/user32/menu.c
> +++ b/dlls/user32/menu.c
> @@ -3077,7 +3077,9 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
>  	    break;
>  	}
>  
> -        TranslateMessage( &msg );
> +        /* Don't translate escape-keydown message because it leads to an unexpected WM_CHAR */
> +        if( !(msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE) )
> +            TranslateMessage( &msg );
>          mt.pt = msg.pt;

You could do it like that, but I think it would be cleaner to move this
into the part that checks keyboard messages, and call TranslateMessage
for messages that have not been handled otherwise.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list