Re: [PATCH v2] user32: Also remove WM_CHAR from queue when a menu gets VK_ESCAPE and add tests
Fabian Maurer <dark.shadow4(a)web.de> writes:
@@ -3186,8 +3186,12 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, break;
case VK_ESCAPE: + { + MSG msg_dummy; fEndMenu = MENU_KeyEscape(&mt, wFlags); - break; + PeekMessageW(&msg_dummy, 0, WM_CHAR, WM_CHAR, PM_REMOVE); + break; + }
It would be cleaner to avoid TranslateMessage instead of removing the message (possibly getting the wrong one). -- Alexandre Julliard julliard(a)winehq.org
It would be cleaner to avoid TranslateMessage instead of removing the message (possibly getting the wrong one).
Sorry, I don't really see the problem. TranslateMessage should always generate a WM_CHAR, how could we get a wrong message? Shouldn't be possible, except for a bug in TranslateMessage, or I'm missing something. I could check for message/wParam to skip TranslateMessage, but I found it cleaner to put it into the handler for VK_ESCAPE. Regards, Fabian Maurer
Fabian Maurer <dark.shadow4(a)web.de> writes:
It would be cleaner to avoid TranslateMessage instead of removing the message (possibly getting the wrong one).
Sorry, I don't really see the problem. TranslateMessage should always generate a WM_CHAR, how could we get a wrong message? Shouldn't be possible, except for a bug in TranslateMessage, or I'm missing something.
TranslateMessage will put a WM_CHAR in the queue, but there may be another one already in there, which would then get removed. -- Alexandre Julliard julliard(a)winehq.org
TranslateMessage will put a WM_CHAR in the queue, but there may be another one already in there, which would then get removed. Right, I missed that. Thanks, I sent a corrected version.
Regards, Fabian Maurer
participants (2)
-
Alexandre Julliard -
Fabian Maurer