From e4cbfef2b5a18337b6ae787db2cc253df721e7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Javier=20Merino=20Mor=C3=A1n?= Date: Thu, 19 May 2022 12:13:45 +0200 Subject: [PATCH] Allow ending wordwise select in mousetracking mode Commit e2167eb0 restricted deactivating the word-wise/line-wise selection mode to mouse presses with no modifiers. Since in mouse-tracking mode, the Shift key has to be pressed to not pass mouse events to the application running on the terminal, there was no way to end word-wise/line-wise selection mode without sending a mouse event to the application. Modify the logic so ending word-wise/line-wise selection mode is done by a LMB button press with no modifiers on non-mousetracking mode, and by a LMB button press with only the Shift modifier on mousetracking mode. BUG: 408048 --- src/terminalDisplay/TerminalDisplay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminalDisplay/TerminalDisplay.cpp b/src/terminalDisplay/TerminalDisplay.cpp index 0f405b17..3cf8c036 100644 --- a/src/terminalDisplay/TerminalDisplay.cpp +++ b/src/terminalDisplay/TerminalDisplay.cpp @@ -1201,7 +1201,7 @@ void TerminalDisplay::mousePressEvent(QMouseEvent *ev) } } - if (!ev->modifiers()) { + if ((!usesMouseTracking() && !ev->modifiers()) || (usesMouseTracking() && ev->modifiers() == Qt::ShiftModifier)) { _lineSelectionMode = false; _wordSelectionMode = false; }