From 7cbbb07fb14ad018cba162d7051f5b2066e73a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Javier=20Merino=20Mor=C3=A1n?= Date: Mon, 15 Mar 2021 12:35:30 +0100 Subject: [PATCH] Do not swallow right button presses on double-click As explained by magiblot at the bug below, "When double clicking with the right button, the sequences sent to the application in the terminal are DOWN-UP-UP instead of DOWN-UP-DOWN-UP." BUG: 425926 --- src/terminalDisplay/TerminalDisplay.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/terminalDisplay/TerminalDisplay.cpp b/src/terminalDisplay/TerminalDisplay.cpp index 9808d152..d4affe76 100644 --- a/src/terminalDisplay/TerminalDisplay.cpp +++ b/src/terminalDisplay/TerminalDisplay.cpp @@ -1576,9 +1576,6 @@ void TerminalDisplay::mouseDoubleClickEvent(QMouseEvent* ev) return; } - if (ev->button() != Qt::LeftButton) { - return; - } if (_screenWindow.isNull()) { return; } @@ -1592,13 +1589,17 @@ void TerminalDisplay::mouseDoubleClickEvent(QMouseEvent* ev) if(!_readOnly) { // Send just _ONE_ click event, since the first click of the double click // was already sent by the click handler - Q_EMIT mouseSignal(0, charColumn + 1, + Q_EMIT mouseSignal(ev->button() == Qt::LeftButton ? 0 : 2, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum(), - 0); // left button + 0); } return; } + if (ev->button() != Qt::LeftButton) { + return; + } + _screenWindow->clearSelection(); _iPntSel = pos; _iPntSel.ry() += _scrollBar->value();