[plasma-mobile] components: partial workaround to the popups eating events

Marco Martin notmart at gmail.com
Wed Sep 7 19:26:51 UTC 2011


Git commit 6d9a9f211c7307434940d5b9bc74293fcf35a73c by Marco Martin.
Committed on 07/09/2011 at 21:21.
Pushed by mart into branch 'master'.

partial workaround to the popups eating events

when a popup window is visible: a click anywhere hides it: but the old qgraphicswidget will continue to think it's under the mouse
doesn't seem to be any good way to properly reset this.
this msolution will still caused a missed click after the popup is gone, but gets the situation unblocked.

anybody has a better idea on this?
CCMAIL:active at kde.org

M  +8    -0    components/mouseeventlistener.cpp

http://commits.kde.org/plasma-mobile/6d9a9f211c7307434940d5b9bc74293fcf35a73c

diff --git a/components/mouseeventlistener.cpp b/components/mouseeventlistener.cpp
index 00f95b9..bf24e71 100644
--- a/components/mouseeventlistener.cpp
+++ b/components/mouseeventlistener.cpp
@@ -37,6 +37,14 @@ MouseEventListener::~MouseEventListener()
 
 void MouseEventListener::mousePressEvent(QGraphicsSceneMouseEvent *me)
 {
+    //FIXME: when a popup window is visible: a click anywhere hides it: but the old qgraphicswidget will continue to think it's under the mouse
+    //doesn't seem to be any good way to properly reset this.
+    //this msolution will still caused a missed click after the popup is gone, but gets the situation unblocked.
+    if (!isUnderMouse()) {
+        me->ignore();
+        return;
+    }
+
     QDeclarativeMouseEvent dme(me->pos().x(), me->pos().y(), me->screenPos().x(), me->screenPos().y(), me->button(), me->buttons(), me->modifiers());
     emit pressed(&dme);
 }



More information about the Active mailing list