12
0
Files
plasma5-workspace/0001-Forward-mouse-enter-and-leave-events-on-feathered-ed.patch

55 lines
2.5 KiB
Diff

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 1/9] 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 34075013b22995d81c98d933db596dff520bd812..28faac44350ccc0ab6a4246045795ba99c7a6ea8 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.6.2