https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c8ed376053a1446522985695c4b413a4a47df47

commit 2c8ed376053a1446522985695c4b413a4a47df47
Author:     David Quintana <[email protected]>
AuthorDate: Thu Jan 18 00:21:14 2018 +0100
Commit:     Giannis Adamopoulos <[email protected]>
CommitDate: Thu Jan 18 02:20:20 2018 +0200

    [EXPLORER] Fix the code that requests the taskbar to recalculate the size,
    after an icon is removed due to missing owner. Also cleaned up the other 
case.
---
 base/shell/explorer/trayntfy.cpp | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/base/shell/explorer/trayntfy.cpp b/base/shell/explorer/trayntfy.cpp
index c6bea2976e..b4e6b6d242 100644
--- a/base/shell/explorer/trayntfy.cpp
+++ b/base/shell/explorer/trayntfy.cpp
@@ -391,19 +391,10 @@ private:
             // Alternatively we could search for them periodically (would 
waste more resources).
             TRACE("Destroying icon %d with invalid handle hWnd=%08x\n", 
notifyItem->uID, notifyItem->hWnd);
 
-            HWND parentHWND = GetParent();
-            parentHWND = ::GetParent(parentHWND);
-
-            RECT windowRect;
-            ::GetClientRect(parentHWND, &windowRect);
-
             RemoveButton(notifyItem);
 
-            SendMessage(parentHWND,
-                WM_SIZE,
-                0,
-                MAKELONG(windowRect.right - windowRect.left,
-                         windowRect.bottom - windowRect.top));
+            HWND parentHWND = ::GetParent(::GetParent(GetParent()));
+            ::SendMessage(parentHWND, WM_SIZE, 0, 0);
 
             return;
         }
@@ -588,12 +579,7 @@ public:
         {
             SYS_PAGER_COPY_DATA * data;
             NOTIFYICONDATA *iconData;
-            HWND parentHWND;
-            RECT windowRect;
             BOOL ret = FALSE;
-            parentHWND = GetParent();
-            parentHWND = ::GetParent(parentHWND);
-            ::GetClientRect(parentHWND, &windowRect);
 
             int VisibleButtonCount = Toolbar.GetVisibleButtonCount();
 
@@ -619,7 +605,8 @@ public:
 
             if (VisibleButtonCount != Toolbar.GetVisibleButtonCount())
             {
-                SendMessage(parentHWND, WM_SIZE, 0, 0);
+                HWND parentHWND = ::GetParent(GetParent());
+                ::SendMessage(parentHWND, WM_SIZE, 0, 0);
             }
 
             return ret;

Reply via email to