parent
542b1e5d42
commit
91f8547073
@ -0,0 +1,54 @@
|
|||||||
|
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);
|
@ -1,54 +0,0 @@
|
|||||||
From 76cb47f1279ea012a9eda11c4ead7f28db4c1399 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Anthony Fieroni <bvbfan@abv.bg>
|
|
||||||
Date: Tue, 1 Dec 2015 09:27:15 +0000
|
|
||||||
Subject: [PATCH 01/15] Forward mouse enter and leave events on feathered edges
|
|
||||||
|
|
||||||
REVIEW: 126175
|
|
||||||
BUG: 354651
|
|
||||||
---
|
|
||||||
shell/panelview.cpp | 22 ++++++++++++++++++++--
|
|
||||||
1 file changed, 20 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/shell/panelview.cpp b/shell/panelview.cpp
|
|
||||||
index 3407501..28faac4 100644
|
|
||||||
--- a/shell/panelview.cpp
|
|
||||||
+++ b/shell/panelview.cpp
|
|
||||||
@@ -748,6 +748,7 @@ 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: {
|
|
||||||
@@ -755,8 +756,25 @@ 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()) && !containmentContainsPosition(me->windowPos())) {
|
|
||||||
- auto me2 = new QMouseEvent(me->type(),
|
|
||||||
+ if (geometry().contains(me->screenPos().toPoint())) {
|
|
||||||
+ if (!containmentContainsPosition(me->windowPos())) {
|
|
||||||
+ auto me2 = new QMouseEvent(me->type(),
|
|
||||||
+ positionAdjustedForContainment(me->windowPos()),
|
|
||||||
+ positionAdjustedForContainment(me->windowPos()),
|
|
||||||
+ positionAdjustedForContainment(me->windowPos()) + position(),
|
|
||||||
+ me->button(), me->buttons(), me->modifiers());
|
|
||||||
+
|
|
||||||
+ 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(),
|
|
||||||
--
|
|
||||||
2.5.0
|
|
||||||
|
|
Loading…
Reference in new issue