diff options
| author | David Rosca <[email protected]> | 2013-11-14 09:08:29 +0100 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-11-14 09:08:29 +0100 |
| commit | c5ba8a56e7f0144d2a74665b4fa459fd45ceedd6 (patch) | |
| tree | 6a85533e2121252a655ca1ce779e436a6058ea12 /src/kitemviews | |
| parent | ae1911e6b0065e73b70311e2a671c98005ff817a (diff) | |
Do not select items when navigating back/forward with the mouse
If we detect that the user pressed the back/forward buttons while
hovering the empty space of the view, such that
DolphinView::slotMouseButtonPressed(int, Qt::MouseButtons) will request
that Dolphin navigates back/forward in the history, handling the mouse
press event should stop. This prevents the possible unexpected selection
of items in the new directory.
BUG: 327412
FIXED-IN: 4.11.4
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 9335ab816..158c12de1 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -537,6 +537,14 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const m_pressedIndex = m_view->itemAt(m_pressedMousePos); emit mouseButtonPressed(m_pressedIndex, event->buttons()); + if ((event->buttons() & (Qt::XButton1 | Qt::XButton2)) && m_pressedIndex < 0) { + // Do not select items when clicking the empty part of the view with + // the back/forward buttons, see https://bugs.kde.org/show_bug.cgi?id=327412. + // Note that clicking an item with these buttons selects it, see comment in + // DolphinView::slotMouseButtonPressed(int, Qt::MouseButtons). + return true; + } + if (m_view->isAboveExpansionToggle(m_pressedIndex, m_pressedMousePos)) { m_selectionManager->endAnchoredSelection(); m_selectionManager->setCurrentItem(m_pressedIndex); |
