diff options
author | brapru <brapru@pm.me> | 2022-02-13 11:56:31 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-13 23:05:39 +0100 |
commit | 93496af02b97167c412c9049be6a19b6b4900541 (patch) | |
tree | e5a8b0384b313a3f7193f4e2b8466a4855bffa1d /Userland/Libraries/LibVT | |
parent | 197ebe3433112e1e4354c4434f094f90fe597260 (diff) | |
download | serenity-93496af02b97167c412c9049be6a19b6b4900541.zip |
LibVT: Fix triple click behavior
When triple clicking a line in the terminal the selection will span the
whole line. However, after dragging down to lines above/below the
selection will stop at the cursor.
Instead, the expected functionality of triple clicking and dragging is
to select the whole line and any whole lines dragged to after the triple
click.
Previously, the triple line counter would get reset as soon as the whole
line was selected. This patch resets the m_triple_click_timer in the
mouse up event, so that the triple click selecting functionality is
maintained during the entire click event and terminated when the event
is over.
Diffstat (limited to 'Userland/Libraries/LibVT')
-rw-r--r-- | Userland/Libraries/LibVT/TerminalWidget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index 8bfe60fed4..c47cdc004d 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -776,6 +776,10 @@ void TerminalWidget::mouseup_event(GUI::MouseEvent& event) m_active_href_id = {}; update(); } + + if (m_triple_click_timer.is_valid()) + m_triple_click_timer.reset(); + set_auto_scroll_direction(AutoScrollDirection::None); } } @@ -809,7 +813,6 @@ void TerminalWidget::mousedown_event(GUI::MouseEvent& event) else if (m_rectangle_selection) m_rectangle_selection = false; - m_triple_click_timer.reset(); update_copy_action(); update(); } |