From 15bc42479a1cff6cd2993650d0184114e9e85767 Mon Sep 17 00:00:00 2001 From: Joseph Bywater Date: Tue, 3 Nov 2020 00:17:02 +0000 Subject: [PATCH] LibGUI: Fix AbstractView selection after initial focusin event After moving the cursor to the home position, clear the selection. Fixes #3925. --- Libraries/LibGUI/AbstractView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/LibGUI/AbstractView.cpp b/Libraries/LibGUI/AbstractView.cpp index 44252474d8..fe80611d61 100644 --- a/Libraries/LibGUI/AbstractView.cpp +++ b/Libraries/LibGUI/AbstractView.cpp @@ -710,8 +710,10 @@ void AbstractView::focusin_event(FocusEvent& event) { ScrollableWidget::focusin_event(event); - if (model() && !cursor_index().is_valid()) + if (model() && !cursor_index().is_valid()) { move_cursor(CursorMovement::Home, SelectionUpdate::None); + clear_selection(); + } } }