When captured moving cursor over other buttons should not produce hot item feedback, only pressed button appearance changes. Hot item notifications are still delivered.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/toolbar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index ec3b49890f..f4bdb60ed8 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -717,7 +717,7 @@ static void TOOLBAR_DrawMasked(HIMAGELIST himl, int index, HDC hdc, INT x, INT y
static UINT -TOOLBAR_TranslateState(const TBUTTON_INFO *btnPtr) +TOOLBAR_TranslateState(const TBUTTON_INFO *btnPtr, BOOL captured) { UINT retstate = 0;
@@ -725,7 +725,7 @@ TOOLBAR_TranslateState(const TBUTTON_INFO *btnPtr) retstate |= (btnPtr->fsState & TBSTATE_PRESSED) ? CDIS_SELECTED : 0; retstate |= (btnPtr->fsState & TBSTATE_ENABLED) ? 0 : CDIS_DISABLED; retstate |= (btnPtr->fsState & TBSTATE_MARKED ) ? CDIS_MARKED : 0; - retstate |= (btnPtr->bHot ) ? CDIS_HOT : 0; + retstate |= (btnPtr->bHot & !captured ) ? CDIS_HOT : 0; retstate |= ((btnPtr->fsState & (TBSTATE_ENABLED|TBSTATE_INDETERMINATE)) == (TBSTATE_ENABLED|TBSTATE_INDETERMINATE)) ? CDIS_INDETERMINATE : 0; /* NOTE: we don't set CDIS_GRAYED, CDIS_FOCUS, CDIS_DEFAULT */ return retstate; @@ -987,7 +987,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, tbcd.rcText.top = 0; tbcd.rcText.right = rcText.right - rc.left; tbcd.rcText.bottom = rcText.bottom - rc.top; - tbcd.nmcd.uItemState = TOOLBAR_TranslateState(btnPtr); + tbcd.nmcd.uItemState = TOOLBAR_TranslateState(btnPtr, infoPtr->bCaptured); tbcd.nmcd.hdc = hdc; tbcd.nmcd.rc = btnPtr->rect; tbcd.hbrMonoDither = COMCTL32_hPattern55AABrush;
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35516 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/toolbar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index f4bdb60ed8..b0c1fb5743 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -5733,7 +5733,10 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SendNotify(&hdr, infoPtr, TBN_TOOLBARCHANGE); } - else if (infoPtr->nButtonDown >= 0) { + else if (infoPtr->nButtonDown >= 0) + { + BOOL was_clicked = nHit == infoPtr->nButtonDown; + btnPtr = &infoPtr->buttons[infoPtr->nButtonDown]; btnPtr->fsState &= ~TBSTATE_PRESSED;
@@ -5775,7 +5778,7 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_ENDDRAG);
- if (btnPtr->fsState & TBSTATE_ENABLED) + if (was_clicked && btnPtr->fsState & TBSTATE_ENABLED) { SendMessageW (infoPtr->hwndNotify, WM_COMMAND, MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)infoPtr->hwndSelf);