Take focus before setting the caret position and selections.
This commit is contained in:
parent
d1297c4493
commit
50523d164f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue