]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't trigger rubberband with back/foward mouse buttons
authorAhmad Samir <a.samirh78@gmail.com>
Thu, 1 Oct 2020 16:21:18 +0000 (18:21 +0200)
committerAhmad Samir <a.samirh78@gmail.com>
Sun, 4 Oct 2020 19:41:40 +0000 (19:41 +0000)
Right now the back/foward mouse buttons work, but also if you hold either
of them and move the mouse the rubberband selection is triggered.

This is the correct fix (instead of commit d0c71a1435bc9d), to match the
original code before the touch events patches,  we need to check the
back/foward buttons after mouseButtonPressed is emitted and before
triggering the rubberbad selection.

src/kitemviews/kitemlistcontroller.cpp

index b7d1da7d259610d75066492e1bd77320664b3b37..60318047de55d201d21243da094d5cc0aa98a95f 100644 (file)
@@ -557,12 +557,6 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const
         return false;
     }
 
-    if (buttons & (Qt::BackButton | Qt::ForwardButton)) {
-        // Do not select items when clicking the back/forward buttons, see
-        // https://bugs.kde.org/show_bug.cgi?id=327412.
-        return true;
-    }
-
     return true;
 }
 
@@ -1423,6 +1417,12 @@ bool KItemListController::onPress(const QPoint& screenPos, const QPointF& pos, c
 {
     emit mouseButtonPressed(m_pressedIndex, buttons);
 
+    if (buttons & (Qt::BackButton | Qt::ForwardButton)) {
+        // Do not select items when clicking the back/forward buttons, see
+        // https://bugs.kde.org/show_bug.cgi?id=327412.
+        return true;
+    }
+
     if (m_view->isAboveExpansionToggle(m_pressedIndex, m_pressedMousePos)) {
         m_selectionManager->endAnchoredSelection();
         m_selectionManager->setCurrentItem(m_pressedIndex);