Module: wine Branch: master Commit: d66fe6206d950eeeabfcf408ae4d199a558150f3 URL: https://gitlab.winehq.org/wine/wine/-/commit/d66fe6206d950eeeabfcf408ae4d199...
Author: Paul Gofman pgofman@codeweavers.com Date: Mon Jan 8 21:05:35 2024 -0600
explorer: Don't pop start menu on "minimize all windows" systray command.
---
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: