[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
This commit is contained in:
Katayama Hirofumi MZ 2020-08-12 06:00:09 +09:00 committed by GitHub
parent 03e6eca3c2
commit 451a9c6f52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 8 deletions

View file

@ -75,17 +75,26 @@ static struct appbar_data* get_appbar(HWND hwnd)
return NULL;
}
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 == 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)
{
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);
}
}
appbar_notify_all(NULL, ABN_POSCHANGED, hwnd, 0);
}
/* appbar_cliprect: cut out parts of the rectangle that interfere with existing appbars */

View file

@ -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: