Commit 50523d16 authored by Jason Mawdsley's avatar Jason Mawdsley Committed by Alexandre Julliard

Take focus before setting the caret position and selections.

parent d1297c44
......@@ -1837,6 +1837,14 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
TRACE("[%04x]: lbuttondown %d,%d item %d\n",
wnd->hwndSelf, x, y, index );
if (!descr->caret_on && (descr->in_focus)) return 0;
if (!descr->in_focus)
{
if( !descr->lphc ) SetFocus( wnd->hwndSelf );
else SetFocus( (descr->lphc->hWndEdit) ? descr->lphc->hWndEdit
: descr->lphc->self->hwndSelf );
}
if (index != -1)
{
if (descr->style & LBS_EXTENDEDSEL)
......@@ -1861,13 +1869,6 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
}
}
if(!descr->in_focus)
{
if( !descr->lphc ) SetFocus( wnd->hwndSelf );
else SetFocus( (descr->lphc->hWndEdit) ? descr->lphc->hWndEdit
: descr->lphc->self->hwndSelf );
}
descr->captured = TRUE;
SetCapture( wnd->hwndSelf );
if (index != -1 && !descr->lphc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment