From c350bb9178fd4d82f2816e22e495550f700da6e9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 24 Apr 2020 19:14:22 +0200 Subject: LibGUI: Fix laggy mouse selection in TextEditor widget We were letting the automatic scrolling timer drive all selection updates to fix an unwanted acceleration that was happening. However, if a mousemove occurs *within* the editor widget, we should just handle it right then and there. --- Libraries/LibGUI/TextEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Libraries/LibGUI/TextEditor.cpp') diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp index c6e399775f..0f6e0e005d 100644 --- a/Libraries/LibGUI/TextEditor.cpp +++ b/Libraries/LibGUI/TextEditor.cpp @@ -301,7 +301,7 @@ void TextEditor::mouseup_event(MouseEvent& event) void TextEditor::mousemove_event(MouseEvent& event) { m_last_mousemove_position = event.position(); - if (m_in_drag_select && !m_automatic_selection_scroll_timer->is_active()) { + if (m_in_drag_select && (rect().contains(event.position()) || !m_automatic_selection_scroll_timer->is_active())) { set_cursor(text_position_at(event.position())); m_selection.set_end(m_cursor); did_update_selection(); -- cgit v1.2.3