┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-02-17 17:12:31 +0000
committerPeter Penz <[email protected]>2009-02-17 17:12:31 +0000
commitc40ed6564e8cd0d58c19f099c1aee6b5f3bcbb69 (patch)
tree3cd046341d95cdeae38c0ea6f705366abcc28ad4
parent02aa3f8ea0317d37a595f5db0e5ab3efb3c8b953 (diff)
When the selection toggle is clicked and the mouse gets moved outside the selection toggle boundaries, a rubberband with a random start position will get visible. Bypass this issue by consuming the mouse-move events.
BUG: 184178 svn path=/trunk/KDE/kdebase/apps/; revision=927488
-rw-r--r--src/selectiontoggle.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/selectiontoggle.cpp b/src/selectiontoggle.cpp
index b9b79def0..01cfed0f3 100644
--- a/src/selectiontoggle.cpp
+++ b/src/selectiontoggle.cpp
@@ -89,9 +89,27 @@ void SelectionToggle::setVisible(bool visible)
bool SelectionToggle::eventFilter(QObject* obj, QEvent* event)
{
- if ((obj == parent()) && (event->type() == QEvent::Leave)) {
- hide();
+ if (obj == parent()) {
+ switch (event->type()) {
+ case QEvent::Leave:
+ hide();
+ break;
+
+ case QEvent::MouseMove:
+ if (m_isHovered) {
+ // Don't forward mouse move events to the viewport,
+ // otherwise a rubberband selection will be shown when
+ // clicking on the selection toggle and moving the mouse
+ // above the viewport.
+ return true;
+ }
+ break;
+
+ default:
+ break;
+ }
}
+
return QAbstractButton::eventFilter(obj, event);
}