From: "Gabriel Ivăncescu" Subject: [PATCH resend 2/2] user32: Set the selection if it's currently invalid in HandleTimer. Message-Id: Date: Thu, 9 Jun 2022 21:46:43 +0300 In-Reply-To: <41c2b918687cf5cc4b8537d553388afac8f93b61.1654800373.git.gabrielopcode@gmail.com> References: <41c2b918687cf5cc4b8537d553388afac8f93b61.1654800373.git.gabrielopcode@gmail.com> This can happen in a combo box if the dropdown is shown by a mouse click + release followed by the mouse being moved into the dropped listbox (when the listbox has nothing selected). In this case, the first item (with the index zero) would not be selected the first time the mouse moves over it. Signed-off-by: Gabriel Ivăncescu --- dlls/user32/listbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 0eed2fd..90ec8f8 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2348,7 +2348,7 @@ static LRESULT LISTBOX_HandleTimer( LB_DESCR *descr, INT index, TIMER_DIRECTION case LB_TIMER_NONE: break; } - if (index == descr->focus_item) return FALSE; + if (index == descr->focus_item && descr->selected_item != -1) return FALSE; LISTBOX_MoveCaret( descr, index, FALSE ); return TRUE; } -- 2.34.1