From a7f4f6afc3e08ae4d4f6e215f00f61368fca594e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 1 Nov 2020 15:42:09 +0100 Subject: [PATCH] LibGUI: Allow dragging a previously unselected item with a single click Views would previously require that an item be selected before it could be dragged. This patch makes us consider initiating a drag immediately after the view has been selected, without requiring a mouseup event in between. --- Libraries/LibGUI/AbstractView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibGUI/AbstractView.cpp b/Libraries/LibGUI/AbstractView.cpp index fe5a8bf355..85406738c6 100644 --- a/Libraries/LibGUI/AbstractView.cpp +++ b/Libraries/LibGUI/AbstractView.cpp @@ -235,6 +235,7 @@ void AbstractView::mousedown_event(MouseEvent& event) set_cursor(index, SelectionUpdate::ClearIfNotSelected); } else { set_cursor(index, SelectionUpdate::Set); + m_might_drag = true; } update();