Alexandre Julliard : user32: Make sure we set menu capture to a window that is visible.
Module: wine Branch: master Commit: 635544e20f52a939ed133fddba0d54f65baf2a2f URL: http://source.winehq.org/git/wine.git/?a=commit;h=635544e20f52a939ed133fddba... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 24 17:59:58 2008 +0100 user32: Make sure we set menu capture to a window that is visible. --- dlls/user32/menu.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 17b2179..2efc415 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -2963,6 +2963,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, INT executedMenuId = -1; MTRACKER mt; BOOL enterIdleSent = FALSE; + HWND capture_win; mt.trackFlags = 0; mt.hCurrentMenu = hmenu; @@ -2991,7 +2992,9 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, if (wFlags & TF_ENDMENU) fEndMenu = TRUE; - set_capture_window( mt.hOwnerWnd, GUI_INMENUMODE, NULL ); + /* owner may not be visible when tracking a popup, so use the menu itself */ + capture_win = (wFlags & TPM_POPUPMENU) ? menu->hWnd : mt.hOwnerWnd; + set_capture_window( capture_win, GUI_INMENUMODE, NULL ); while (!fEndMenu) {
participants (1)
-
Alexandre Julliard