From 24268a4df5d4fe0a856d17ca878d793527a1188e Mon Sep 17 00:00:00 2001 From: Amol Godbole Date: Mon, 1 Apr 2024 23:14:13 -0500 Subject: 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 --- src/kitemviews/kitemlistcontroller.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/kitemviews/kitemlistcontroller.cpp') 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()) { -- cgit v1.3