[NTDLL][NTUSER] Fix unselected text after WM_CBLOSTTEXTFOCUS

When we unselect text after the WM_CBLOSTTEXTFOCUS message,
make sure we also forget we have been focused at all;
otherwise the edit may become focused again, but with an
empty text selection.

CORE-10266
This commit is contained in:
Manuel Bachmann 2017-11-02 02:06:50 +01:00 committed by Timo Kreuzer
parent c97e9defc1
commit 71ab0b5d4c
2 changed files with 8 additions and 19 deletions

View file

@ -3626,7 +3626,6 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
*/
static LRESULT EDIT_WM_KillFocus(EDITSTATE *es)
{
#if 0 // See CORE-10266.
HWND hCombo;
LONG lStyles;
@ -3647,15 +3646,7 @@ static LRESULT EDIT_WM_KillFocus(EDITSTATE *es)
if ((lStyles & CBS_DROPDOWN) || (lStyles & CBS_SIMPLE))
SendMessage(hCombo, WM_CBLOSTTEXTFOCUS, 0, 0);
}
#else
es->flags &= ~EF_FOCUSED;
DestroyCaret();
if(!(es->style & ES_NOHIDESEL))
EDIT_InvalidateText(es, es->selection_start, es->selection_end);
EDIT_NOTIFY_PARENT(es, EN_KILLFOCUS);
/* throw away left over scroll when we lose focus */
es->wheelDeltaRemainder = 0;
#endif
return 0;
}