You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
2.4 KiB
55 lines
2.4 KiB
9 years ago
|
diff --git a/shell/panelview.cpp b/shell/panelview.cpp
|
||
|
index 063343d..893def0 100644
|
||
|
--- a/shell/panelview.cpp
|
||
|
+++ b/shell/panelview.cpp
|
||
|
@@ -748,7 +748,6 @@ bool PanelView::event(QEvent *e)
|
||
|
* on the mouse edge, forward the click in the containment boundaries
|
||
|
*/
|
||
|
switch (e->type()) {
|
||
|
- case QEvent::Enter:
|
||
|
case QEvent::MouseMove:
|
||
|
case QEvent::MouseButtonPress:
|
||
|
case QEvent::MouseButtonRelease: {
|
||
|
@@ -756,7 +755,7 @@ bool PanelView::event(QEvent *e)
|
||
|
|
||
|
//first, don't mess with position if the cursor is actually outside the view:
|
||
|
//somebody is doing a click and drag that must not break when the cursor i outside
|
||
|
- if (geometry().contains(me->screenPos().toPoint())) {
|
||
|
+ if (geometry().contains(QCursor::pos())) {
|
||
|
if (!containmentContainsPosition(me->windowPos())) {
|
||
|
auto me2 = new QMouseEvent(me->type(),
|
||
|
positionAdjustedForContainment(me->windowPos()),
|
||
|
@@ -767,25 +766,19 @@ bool PanelView::event(QEvent *e)
|
||
|
QCoreApplication::postEvent(this, me2);
|
||
|
return true;
|
||
|
}
|
||
|
- }
|
||
|
- break;
|
||
|
- }
|
||
|
- case QEvent::Leave: {
|
||
|
- QMouseEvent *me = static_cast<QMouseEvent *>(e);
|
||
|
- // don't forget to trigger QEvent::Leave if current mouse position is outside the panel
|
||
|
- if (!geometry().contains(me->screenPos().toPoint())) {
|
||
|
- auto me2 = new QMouseEvent(QEvent::Leave,
|
||
|
- positionAdjustedForContainment(me->windowPos()),
|
||
|
- positionAdjustedForContainment(me->windowPos()),
|
||
|
- positionAdjustedForContainment(me->windowPos()) + position(),
|
||
|
- me->button(), me->buttons(), me->modifiers());
|
||
|
-
|
||
|
- QCoreApplication::postEvent(this, me2);
|
||
|
+ } else {
|
||
|
+ // discard event if current mouse position is outside the panel
|
||
|
return true;
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
+ case QEvent::Enter:
|
||
|
+ case QEvent::Leave:
|
||
|
+ // QtQuick < 5.6 issue:
|
||
|
+ // QEvent::Leave is triggered on MouseButtonPress Qt::LeftButton
|
||
|
+ break;
|
||
|
+
|
||
|
case QEvent::Wheel: {
|
||
|
QWheelEvent *we = static_cast<QWheelEvent *>(e);
|