[PATCH 1/2] user32: Allow sent WM_CANCELMODE to end menu tracking in a window's menu bar. [resend]

Ken Thomases ken at codeweavers.com
Fri May 17 00:40:30 CDT 2013


On the Mac, using either the X11 or Mac driver, using Command-Tab to switch away
from a Wine window with a menu leaves it in menu tracking mode.  Mac OS X
synthesizes a key-up event for the Command key before delivering the focus loss
event.  So, the default winproc sees WM_SYSKEYUP/VK_MENU, which causes it to
start menu tracking.  Both drivers send WM_CANCELMODE on loss of focus which
causes the default winproc to call MENU_EndMenu() but it didn't work because
menu->hwndOwner == 0 in this case.

I suspect that the bug can be reproduced on Linux by pressing and releasing Alt
to begin menu tracking and then clicking on some other window.  Posting the
WM_CANCELMODE rather than sending it works around the bug because that's handled
directly by MENU_TrackMenu() rather than the default winproc and MENU_EndMenu().
---
dlls/user32/menu.c |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-user32-Allow-sent-WM_CANCELMODE-to-end-menu-tracking.patch
Type: text/x-patch
Size: 490 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130517/f283ec40/attachment.bin>


More information about the wine-patches mailing list