Mikołaj Zalewski : comctl32: toolbar: Use nHotItem not nOldHit for the hot item in MouseLeave.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Oct 14 14:13:47 CDT 2006


Module: wine
Branch: master
Commit: 010f31f413dc63bbe01fc411296ee2902af179e2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=010f31f413dc63bbe01fc411296ee2902af179e2

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Sat Oct 14 19:54:25 2006 +0200

comctl32: toolbar: Use nHotItem not nOldHit for the hot item in MouseLeave.

---

 dlls/comctl32/toolbar.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 5758356..ac85b46 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -5973,14 +5973,15 @@ static LRESULT
 TOOLBAR_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
 {
     TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
-    TBUTTON_INFO *hotBtnPtr;
-
-    hotBtnPtr = &infoPtr->buttons[infoPtr->nOldHit];
 
     /* don't remove hot effects when in anchor highlighting mode or when a
      * drop-down button is pressed */
-    if (!infoPtr->bAnchor && (infoPtr->nOldHit < 0 || !hotBtnPtr->bDropDownPressed))
-        TOOLBAR_SetHotItemEx(infoPtr, TOOLBAR_NOWHERE, HICF_MOUSE);
+    if (infoPtr->nHotItem >= 0 && !infoPtr->bAnchor)
+    {
+        TBUTTON_INFO *hotBtnPtr = &infoPtr->buttons[infoPtr->nHotItem];
+        if (!hotBtnPtr->bDropDownPressed)
+            TOOLBAR_SetHotItemEx(infoPtr, TOOLBAR_NOWHERE, HICF_MOUSE);
+    }
 
     if (infoPtr->nOldHit < 0)
       return TRUE;
@@ -5996,7 +5997,7 @@ TOOLBAR_MouseLeave (HWND hwnd, WPARAM wP
 
       btnPtr->fsState &= ~TBSTATE_PRESSED;
 
-      rc1 = hotBtnPtr->rect;
+      rc1 = btnPtr->rect;
       InflateRect (&rc1, 1, 1);
       InvalidateRect (hwnd, &rc1, TRUE);
     }




More information about the wine-cvs mailing list