[PATCH v2 0/2] MR5025: explorer: Don't pop start menu on "minimize all windows" systray command.
Fixes "True Reporter. Mystery of Mistwood" broken startup from launcher when the launcher wants to minimize all windows (which is probably not strictly necessary) but we instead pop Start menu. -- v2: explorer: Don't pop start menu on "undo minimize all windows" systray command. explorer: Don't pop start menu on "minimize all windows" systray command. https://gitlab.winehq.org/wine/wine/-/merge_requests/5025
From: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/user32/tests/win.c | 29 ++++++++++++++++++++++++++++- programs/explorer/systray.c | 12 +++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 8dad718e357..26b1f0098dd 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1796,7 +1796,7 @@ static void test_shell_window(void) WaitForSingleObject(hthread, INFINITE); - DeleteObject(hthread); + CloseHandle(hthread); CloseDesktop(hdesk); } @@ -13033,6 +13033,32 @@ static void test_WM_NCCALCSIZE(void) DestroyWindow(hwnd); } +#define TRAY_MINIMIZE_ALL 419 + +static void test_shell_tray(void) +{ + HWND hwnd, traywnd; + + if (!(traywnd = FindWindowA( "Shell_TrayWnd", NULL ))) + { + skip( "Shell_TrayWnd not found, skipping tests.\n" ); + return; + } + + hwnd = CreateWindowW( L"static", L"parent", WS_OVERLAPPEDWINDOW|WS_VISIBLE, + 100, 100, 200, 200, 0, 0, 0, NULL ); + ok( !!hwnd, "failed, error %lu.\n", GetLastError() ); + flush_events( TRUE ); + + ok( !IsIconic( hwnd ), "window is minimized.\n" ); + + SendMessageA( traywnd, WM_COMMAND, TRAY_MINIMIZE_ALL, 0xdeadbeef ); + flush_events( TRUE ); + todo_wine ok( IsIconic( hwnd ), "window is not minimized.\n" ); + + DestroyWindow(hwnd); +} + START_TEST(win) { char **argv; @@ -13229,4 +13255,5 @@ START_TEST(win) test_topmost(); test_shell_window(); + test_shell_tray(); } diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 3b4e5bdc8ac..99a5a99490d 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -33,6 +33,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(systray); +#define TRAY_MINIMIZE_ALL 419 + struct notify_data /* platform-independent format for NOTIFYICONDATA */ { LONG hWnd; @@ -1060,7 +1062,15 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP break; case WM_COMMAND: - if (HIWORD(wparam) == BN_CLICKED) click_taskbar_button( (HWND)lparam ); + if (HIWORD(wparam) == BN_CLICKED) + { + if (LOWORD(wparam) == TRAY_MINIMIZE_ALL) + { + FIXME( "Shell command %u is not supported.\n", LOWORD(wparam) ); + break; + } + click_taskbar_button( (HWND)lparam ); + } break; case WM_CONTEXTMENU: -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5025
From: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/user32/tests/win.c | 5 +++++ programs/explorer/systray.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 26b1f0098dd..1b03e64181a 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -13034,6 +13034,7 @@ static void test_WM_NCCALCSIZE(void) } #define TRAY_MINIMIZE_ALL 419 +#define TRAY_MINIMIZE_ALL_UNDO 416 static void test_shell_tray(void) { @@ -13056,6 +13057,10 @@ static void test_shell_tray(void) flush_events( TRUE ); todo_wine ok( IsIconic( hwnd ), "window is not minimized.\n" ); + SendMessageA( traywnd, WM_COMMAND, TRAY_MINIMIZE_ALL_UNDO, 0xdeadbeef ); + flush_events( TRUE ); + ok( !IsIconic( hwnd ), "window is minimized.\n" ); + DestroyWindow(hwnd); } diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 99a5a99490d..43187db30b5 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -34,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(systray); #define TRAY_MINIMIZE_ALL 419 +#define TRAY_MINIMIZE_ALL_UNDO 416 struct notify_data /* platform-independent format for NOTIFYICONDATA */ { @@ -1064,7 +1065,7 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP case WM_COMMAND: if (HIWORD(wparam) == BN_CLICKED) { - if (LOWORD(wparam) == TRAY_MINIMIZE_ALL) + if (LOWORD(wparam) == TRAY_MINIMIZE_ALL || LOWORD(wparam) == TRAY_MINIMIZE_ALL_UNDO) { FIXME( "Shell command %u is not supported.\n", LOWORD(wparam) ); break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5025
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=142848 Your paranoid android. === build (build log) === error: patch failed: dlls/user32/tests/win.c:13034 error: patch failed: programs/explorer/systray.c:34 Task: Patch failed to apply === debian11 (build log) === error: patch failed: dlls/user32/tests/win.c:13034 error: patch failed: programs/explorer/systray.c:34 Task: Patch failed to apply === debian11b (build log) === error: patch failed: dlls/user32/tests/win.c:13034 error: patch failed: programs/explorer/systray.c:34 Task: Patch failed to apply
v2: - define a constant for 419; - add a patch with similar handling for "undo minimize all windows" (416). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5025#note_60259
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5025
participants (4)
-
Marvin -
Paul Gofman -
Paul Gofman (@gofman) -
Rémi Bernon