┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWolfgang Müller <[email protected]>2024-10-14 18:43:28 +0200
committerMéven Car <[email protected]>2024-10-17 14:07:49 +0000
commit819960aed450d9aa40fd42dc42ad7119c88a4802 (patch)
treef078fe064c8e771be94c84d09cd96d99a93b41ff /src
parent9eff562cb6067c3e85322382c71482ba94ef643b (diff)
kitemlistcontroller: process forward/back buttons when double-clicking
Tapping the forward or back mouse buttons quickly enough makes Dolphin interpret the action as a double-click of the button in question and handle it in mouseDoubleClickEvent() instead of its normal button handler. This means that certain button presses might seem delayed or "swallowed" when quickly navigating forwards or backwards through the history. Since a double-click of the forward or back button is currently meaningless, fix this by emitting a normal mouseButtonPressed event for those buttons in the double-click handler and skipping any further event processing. Co-authored-by: Felix Ernst <[email protected]> CCBUG: 485295
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kitemlistcontroller.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp
index 997e6623b..821e1b75f 100644
--- a/src/kitemviews/kitemlistcontroller.cpp
+++ b/src/kitemviews/kitemlistcontroller.cpp
@@ -700,6 +700,15 @@ bool KItemListController::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event,
const QPointF pos = transform.map(event->pos());
const std::optional<int> index = m_view->itemAt(pos);
+ if (event->button() & (Qt::ForwardButton | Qt::BackButton)) {
+ // "Forward" and "Back" are reserved for quickly navigating through the
+ // history. Double-clicking those buttons should be interpreted as two
+ // separate button presses. We arrive here for the second click, which
+ // we now react to just as we would for a singular click
+ Q_EMIT mouseButtonPressed(index.value_or(-1), event->button());
+ return false;
+ }
+
if (!index.has_value()) {
Q_EMIT doubleClickViewBackground(event->button());
return false;