WM_MOUSEMOVE implementation bug fix.
diff --git a/controls/listbox.c b/controls/listbox.c
index 899a73b..27bb775 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -64,6 +64,7 @@
INT nb_tabs; /* Number of tabs in array */
INT *tabs; /* Array of tabs */
BOOL caret_on; /* Is caret on? */
+ BOOL captured; /* Is mouse captured? */
HFONT font; /* Current font */
LCID locale; /* Current locale for string comparisons */
LPHEADCOMBO lphc; /* ComboLBox */
@@ -1752,6 +1753,7 @@
else SetFocus( (descr->lphc->hWndEdit) ? descr->lphc->hWndEdit
: descr->lphc->self->hwndSelf ) ;
+ descr->captured = TRUE;
SetCapture( wnd->hwndSelf );
if (index != -1 && !descr->lphc)
{
@@ -1777,9 +1779,10 @@
if (LISTBOX_Timer != LB_TIMER_NONE)
KillSystemTimer( wnd->hwndSelf, LB_TIMER_ID );
LISTBOX_Timer = LB_TIMER_NONE;
- if (GetCapture() == wnd->hwndSelf)
+ if (descr->captured)
{
- ReleaseCapture();
+ descr->captured = FALSE;
+ if (GetCapture() == wnd->hwndSelf) ReleaseCapture();
if (descr->style & LBS_NOTIFY)
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
}
@@ -1850,6 +1853,8 @@
INT index;
TIMER_DIRECTION dir;
+ if (!descr->captured) return;
+
if (descr->style & LBS_MULTICOLUMN)
{
if (y < 0) y = 0;
@@ -2052,6 +2057,7 @@
descr->nb_tabs = 0;
descr->tabs = NULL;
descr->caret_on = TRUE;
+ descr->captured = FALSE;
descr->font = 0;
descr->locale = 0; /* FIXME */
descr->lphc = lphc;