comctl32/toolbar: Send BN_CLICKED for button that was pressed, not released.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35516 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f037019e5d
commit
f3775ed2ac
|
@ -5733,7 +5733,10 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
TOOLBAR_SendNotify(&hdr, infoPtr, TBN_TOOLBARCHANGE);
|
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 = &infoPtr->buttons[infoPtr->nButtonDown];
|
||||||
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
||||||
|
|
||||||
|
@ -5775,7 +5778,7 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
|
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
|
||||||
TBN_ENDDRAG);
|
TBN_ENDDRAG);
|
||||||
|
|
||||||
if (btnPtr->fsState & TBSTATE_ENABLED)
|
if (was_clicked && btnPtr->fsState & TBSTATE_ENABLED)
|
||||||
{
|
{
|
||||||
SendMessageW (infoPtr->hwndNotify, WM_COMMAND,
|
SendMessageW (infoPtr->hwndNotify, WM_COMMAND,
|
||||||
MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)infoPtr->hwndSelf);
|
MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)infoPtr->hwndSelf);
|
||||||
|
|
Loading…
Reference in New Issue