From 14c68ccd3f89c53d7f6214a40323431be4baeb9f Mon Sep 17 00:00:00 2001 From: David Quintana Date: Mon, 19 May 2014 10:44:33 +0000 Subject: [PATCH] [EXPLORER-NEW] * Default to always-on-top if the registry setting is not found. * Reload and apply settings on display change. Fixes taskbar not repositioning on resolution changes. CORE-7330 svn path=/branches/shell-experiments/; revision=63369 --- base/shell/explorer-new/traywnd.c | 32 ++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/base/shell/explorer-new/traywnd.c b/base/shell/explorer-new/traywnd.c index 0b77f4e32aa..506409d56f9 100644 --- a/base/shell/explorer-new/traywnd.c +++ b/base/shell/explorer-new/traywnd.c @@ -768,15 +768,6 @@ ITrayWindowImpl_RegLoadSettings(IN OUT ITrayWindowImpl *This) /* FIXME: Are there more flags? */ - if (This->hWnd != NULL) - SetWindowPos (This->hWnd, - This->AlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, - 0, - 0, - 0, - 0, - SWP_NOMOVE | SWP_NOSIZE); - if (sr.Position > ABE_BOTTOM) This->Position = ABE_BOTTOM; else @@ -794,6 +785,7 @@ ITrayWindowImpl_RegLoadSettings(IN OUT ITrayWindowImpl *This) else { This->Position = ABE_BOTTOM; + This->AlwaysOnTop = TRUE; /* Use the minimum size of the taskbar, we'll use the start button as a minimum for now. Make sure we calculate the @@ -813,6 +805,15 @@ ITrayWindowImpl_RegLoadSettings(IN OUT ITrayWindowImpl *This) MONITOR_DEFAULTTOPRIMARY); } + if (This->hWnd != NULL) + SetWindowPos(This->hWnd, + This->AlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, + 0, + 0, + 0, + 0, + SWP_NOMOVE | SWP_NOSIZE); + /* Determine a minimum tray window rectangle. The "client" height is zero here since we cannot determine an optimal minimum width when loaded as a vertical tray window. We just need to make sure the values @@ -2151,6 +2152,19 @@ TrayWndProc(IN HWND hwnd, switch (uMsg) { + case WM_DISPLAYCHANGE: + + /* Load the saved tray window settings */ + ITrayWindowImpl_RegLoadSettings(This); + + /* Move the tray window to the right position and resize it if neccessary */ + ITrayWindowImpl_CheckTrayWndPosition(This); + + /* Align all controls on the tray window */ + ITrayWindowImpl_AlignControls(This, NULL); + + break; + case WM_COPYDATA: { if (This->hwndTrayNotify)