diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4cf31d5d..3dafb667 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -332,6 +332,7 @@ patch_enable_all () enable_user32_Mouse_Message_Hwnd="$1" enable_user32_PNG_Support="$1" enable_user32_Refresh_MDI_Menus="$1" + enable_user32_Revert_Popup_Menu="$1" enable_user32_ScrollWindowEx="$1" enable_user32_SetCoalescableTimer="$1" enable_user32_WM_CTLCOLORBTN="$1" @@ -1174,6 +1175,9 @@ patch_enable () user32-Refresh_MDI_Menus) enable_user32_Refresh_MDI_Menus="$2" ;; + user32-Revert_Popup_Menu) + enable_user32_Revert_Popup_Menu="$2" + ;; user32-ScrollWindowEx) enable_user32_ScrollWindowEx="$2" ;; @@ -6848,6 +6852,21 @@ if test "$enable_user32_Refresh_MDI_Menus" -eq 1; then ) >> "$patchlist" fi +# Patchset user32-Revert_Popup_Menu +# | +# | This patchset fixes the following Wine bugs: +# | * [#40474] Fix a regression causing popup menus stay open +# | +# | Modified files: +# | * dlls/user32/menu.c +# | +if test "$enable_user32_Revert_Popup_Menu" -eq 1; then + patch_apply user32-Revert_Popup_Menu/0001-Revert-user32-Set-capture-earlier-on-popup-menus.patch + ( + echo '+ { "Sebastian Lackner", "Revert \"user32: Set capture earlier on popup menus.\".", 1 },'; + ) >> "$patchlist" +fi + # Patchset user32-ScrollWindowEx # | # | This patchset fixes the following Wine bugs: diff --git a/patches/user32-Revert_Popup_Menu/0001-Revert-user32-Set-capture-earlier-on-popup-menus.patch b/patches/user32-Revert_Popup_Menu/0001-Revert-user32-Set-capture-earlier-on-popup-menus.patch new file mode 100644 index 00000000..9ac7ea4d --- /dev/null +++ b/patches/user32-Revert_Popup_Menu/0001-Revert-user32-Set-capture-earlier-on-popup-menus.patch @@ -0,0 +1,58 @@ +From 2a11dd26b5c7b20fb3c8d30c0948a0eea60e9237 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 19 Apr 2016 15:41:46 +0200 +Subject: Revert "user32: Set capture earlier on popup menus." + +This reverts commit a9bff001a1e2c919b3f6e68d642abb8da957a2bf. +--- + dlls/user32/menu.c | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c +index 7a49ac0..e42d8f7 100644 +--- a/dlls/user32/menu.c ++++ b/dlls/user32/menu.c +@@ -3003,6 +3003,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; +@@ -3030,8 +3031,9 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, + + if (wFlags & TF_ENDMENU) fEndMenu = TRUE; + +- if (!(wFlags & TPM_POPUPMENU)) +- 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 ); + + if ((wFlags & TPM_POPUPMENU) && menu->nItems == 0) + return FALSE; +@@ -3327,10 +3329,6 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags) + + SendMessageW( hWnd, WM_SETCURSOR, (WPARAM)hWnd, HTCAPTION ); + +- if (bPopup) +- /* owner may not be visible when tracking a popup, so use the menu itself */ +- set_capture_window( menu->hWnd, GUI_INMENUMODE, NULL ); +- + if (!(wFlags & TPM_NONOTIFY)) + { + SendMessageW( hWnd, WM_INITMENU, (WPARAM)hMenu, 0 ); +@@ -3484,9 +3482,6 @@ BOOL WINAPI TrackPopupMenuEx( HMENU hMenu, UINT wFlags, INT x, INT y, + if (MENU_ShowPopup( hWnd, hMenu, 0, wFlags, x, y, 0, 0 )) + ret = MENU_TrackMenu( hMenu, wFlags | TPM_POPUPMENU, 0, 0, hWnd, + lpTpm ? &lpTpm->rcExclude : NULL ); +- +- set_capture_window( 0, GUI_INMENUMODE, NULL ); +- + MENU_ExitTracking(hWnd, TRUE); + + if (menu->hWnd) +-- +2.7.1 + diff --git a/patches/user32-Revert_Popup_Menu/definition b/patches/user32-Revert_Popup_Menu/definition new file mode 100644 index 00000000..f3a41581 --- /dev/null +++ b/patches/user32-Revert_Popup_Menu/definition @@ -0,0 +1 @@ +Fixes: [40474] Fix a regression causing popup menus stay open