https://git.reactos.org/?p=reactos.git;a=commitdiff;h=451a9c6f5289c74dd1906d...
commit 451a9c6f5289c74dd1906dd72e9404b32bc0ffd3 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Wed Aug 12 06:00:09 2020 +0900 Commit: GitHub noreply@github.com CommitDate: Wed Aug 12 06:00:09 2020 +0900
[EXPLORER] Implement ABN_WINDOWARRANGE (#3033)
The AppBar window has to receive the ABN_WINDOWARRANGE notification message before and after the window arrangement from taskbar. CORE-7237 --- base/shell/explorer/appbar.cpp | 21 +++++++++++++++------ base/shell/explorer/traywnd.cpp | 7 +++++++ 2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/base/shell/explorer/appbar.cpp b/base/shell/explorer/appbar.cpp index f3a3e880692..3f980ec589f 100644 --- a/base/shell/explorer/appbar.cpp +++ b/base/shell/explorer/appbar.cpp @@ -75,19 +75,28 @@ static struct appbar_data* get_appbar(HWND hwnd) return NULL; }
-/* send_poschanged: send ABN_POSCHANGED to every appbar except one */ -static void send_poschanged(HWND hwnd) +void appbar_notify_all(HMONITOR hMon, UINT uMsg, HWND hwndExclude, LPARAM lParam) { struct appbar_data* data; + LIST_FOR_EACH_ENTRY(data, &appbars, struct appbar_data, entry) { - if (data->hwnd != hwnd) - { - PostMessageW(data->hwnd, data->callback_msg, ABN_POSCHANGED, 0); - } + if (data->hwnd == hwndExclude) + continue; + + if (hMon && hMon != MonitorFromWindow(data->hwnd, MONITOR_DEFAULTTONULL)) + continue; + + SendMessageW(data->hwnd, data->callback_msg, uMsg, lParam); } }
+/* send_poschanged: send ABN_POSCHANGED to every appbar except one */ +static void send_poschanged(HWND hwnd) +{ + appbar_notify_all(NULL, ABN_POSCHANGED, hwnd, 0); +} + /* appbar_cliprect: cut out parts of the rectangle that interfere with existing appbars */ static void appbar_cliprect( HWND hwnd, RECT *rect ) { diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp index 2e081329d19..8dd491b0678 100644 --- a/base/shell/explorer/traywnd.cpp +++ b/base/shell/explorer/traywnd.cpp @@ -24,6 +24,7 @@
HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu); LRESULT appbar_message(COPYDATASTRUCT* cds); +void appbar_notify_all(HMONITOR hMon, UINT uMsg, HWND hwndExclude, LPARAM lParam);
#define WM_APP_TRAYDESTROY (WM_APP + 0x100)
@@ -608,15 +609,21 @@ public: break;
case ID_SHELL_CMD_TILE_WND_H: + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE); TileWindows(NULL, MDITILE_HORIZONTAL, NULL, 0, NULL); + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE); break;
case ID_SHELL_CMD_TILE_WND_V: + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE); TileWindows(NULL, MDITILE_VERTICAL, NULL, 0, NULL); + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE); break;
case ID_SHELL_CMD_CASCADE_WND: + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE); CascadeWindows(NULL, MDITILE_SKIPDISABLED, NULL, 0, NULL); + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE); break;
case ID_SHELL_CMD_CUST_NOTIF: