From d8daa0835984be05f6cdf4beca06028355c48b0e Mon Sep 17 00:00:00 2001 From: remyabel <47402505+remyabel@users.noreply.github.com> Date: Tue, 10 Dec 2019 04:24:14 -0500 Subject: [PATCH] GTreeView: Prevent doubleclick with right mouse button (#868) This follows user expectations and prevents interference with context menu handling. --- Libraries/LibGUI/GTreeView.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Libraries/LibGUI/GTreeView.cpp b/Libraries/LibGUI/GTreeView.cpp index 716eaccda8..c363a9ea28 100644 --- a/Libraries/LibGUI/GTreeView.cpp +++ b/Libraries/LibGUI/GTreeView.cpp @@ -94,11 +94,13 @@ void GTreeView::doubleclick_event(GMouseEvent& event) if (!index.is_valid()) return; - if (selection().first() != index) - selection().set(index); + if (event.button() == GMouseButton::Left) { + if (selection().first() != index) + selection().set(index); - if (model.row_count(index)) - toggle_index(index); + if (model.row_count(index)) + toggle_index(index); + } } void GTreeView::toggle_index(const GModelIndex& index)