]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.cpp
Don't deselect on Ctrl+Right-Click
[dolphin.git] / src / kitemviews / kitemlistcontroller.cpp
index ba4047dbe8c85661f50ec3a7e311b451f06872c2..994812b1fc575424dba7a7f0c953c3f85f06adb1 100644 (file)
@@ -1497,6 +1497,7 @@ bool KItemListController::onPress(const QPoint& screenPos, const QPointF& pos, c
 
     const bool shiftPressed = modifiers & Qt::ShiftModifier;
     const bool controlPressed = modifiers & Qt::ControlModifier;
 
     const bool shiftPressed = modifiers & Qt::ShiftModifier;
     const bool controlPressed = modifiers & Qt::ControlModifier;
+    const bool leftClick = buttons & Qt::LeftButton;
     const bool rightClick = buttons & Qt::RightButton;
 
     // The previous selection is cleared if either
     const bool rightClick = buttons & Qt::RightButton;
 
     // The previous selection is cleared if either
@@ -1600,8 +1601,8 @@ bool KItemListController::onPress(const QPoint& screenPos, const QPointF& pos, c
             break;
 
         case MultiSelection:
             break;
 
         case MultiSelection:
-            if (controlPressed && !shiftPressed) {
-                // A mouse button press is happening on an item while control is pressed. This either means a user wants to:
+            if (controlPressed && !shiftPressed && leftClick) {
+                // A left mouse button press is happening on an item while control is pressed. This either means a user wants to:
                 // - toggle the selection of item(s) or
                 // - they want to begin a drag on the item(s) to copy them.
                 // We rule out the latter, if the item is not clicked directly and was unselected previously.
                 // - toggle the selection of item(s) or
                 // - they want to begin a drag on the item(s) to copy them.
                 // We rule out the latter, if the item is not clicked directly and was unselected previously.