From: Amol Godbole Date: Tue, 2 Apr 2024 04:14:13 +0000 (-0500) Subject: KItemListController: don't create rubber band for a right click in an empty region X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/24268a4df5d4fe0a856d17ca878d793527a1188e KItemListController: don't create rubber band for a right click in an empty region Rubber band was being incorrectly created for a right click in an empty region. Handle this case in KItemListController::onPress(). BUG: 484881 --- diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 3ab20640c..2cda2987b 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -1698,6 +1698,11 @@ bool KItemListController::onPress(const QPointF &pos, const Qt::KeyboardModifier rubberBand->setActive(false); m_view->setAutoScroll(false); } + + if (!m_pressedIndex.has_value()) { + // We have a right-click in an empty region, don't create rubber band. + return true; + } } if (m_pressedIndex.has_value()) {