Using WM_MOUSEMOVE events to determine whether the dropdown button is hovered is unreliable and thus the dropdown button may stay in hovered state even if mouse has left the window.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/comctl32/combo.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/dlls/comctl32/combo.c b/dlls/comctl32/combo.c index 572740b5cfd..887587a053b 100644 --- a/dlls/comctl32/combo.c +++ b/dlls/comctl32/combo.c @@ -1632,6 +1632,13 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam ) } }
+static LRESULT COMBO_MouseLeave(LPHEADCOMBO lphc) +{ + lphc->wState &= ~CBF_HOT; + RedrawWindow(lphc->self, &lphc->buttonRect, 0, RDW_INVALIDATE | RDW_UPDATENOW); + return 0; +} + static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *pcbi) { if (!pcbi || (pcbi->cbSize < sizeof(COMBOBOXINFO))) @@ -1871,6 +1878,7 @@ static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam case WM_MOUSEMOVE: if (!IsRectEmpty(&lphc->buttonRect)) { + TRACKMOUSEEVENT event; POINT pt;
pt.x = (short)LOWORD(lParam); @@ -1882,6 +1890,15 @@ static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam { lphc->wState |= CBF_HOT; RedrawWindow(hwnd, &lphc->buttonRect, 0, RDW_INVALIDATE | RDW_UPDATENOW); + + event.cbSize = sizeof(TRACKMOUSEEVENT); + event.dwFlags = TME_QUERY; + if (!TrackMouseEvent(&event) || event.hwndTrack != hwnd || !(event.dwFlags & TME_LEAVE)) + { + event.hwndTrack = hwnd; + event.dwFlags = TME_LEAVE; + TrackMouseEvent(&event); + } } } else if (lphc->wState & CBF_HOT) @@ -1895,6 +1912,9 @@ static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam COMBO_MouseMove( lphc, wParam, lParam ); return TRUE;
+ case WM_MOUSELEAVE: + return COMBO_MouseLeave(lphc); + case WM_MOUSEWHEEL: if (wParam & (MK_SHIFT | MK_CONTROL)) return DefWindowProcW(hwnd, message, wParam, lParam);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=86271
Your paranoid android.
=== debiant2 (build log) ===
Task: WineTest did not produce the win32 report
=== debiant2 (build log) ===
Task: WineTest did not produce the wow32 report