summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-06-18 15:53:30 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-21 00:58:22 +0200
commitec2e99ead57bfa81c65f6c8435f20d9fb0ae4fd5 (patch)
treea77af5b7b0ca027a557f3cd1a872ae9d0d64e1a7 /src
parent98fd2eeb6292d3391b7364493b960f818896fa23 (diff)
Fixed mouse grabbing preventing popups from being closed.
The pointer grabbing leads to fake Enter events being sent to the Qt::Popup window, preventing it from closing since QWidget::underMouse() returns true. We should only send Enter events if the mouse is actually inside the widget. Change-Id: I4ba3fb08943580f93ad4337ff0227becd647767e Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qapplication.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 7999eeb109..eecf590c86 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2480,6 +2480,8 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event,
const bool graphicsWidget = nativeWidget->testAttribute(Qt::WA_DontShowOnScreen);
+ bool widgetUnderMouse = QRectF(receiver->rect()).contains(event->localPos());
+
if (*buttonDown) {
if (!graphicsWidget) {
// Register the widget that shall receive a leave event
@@ -2489,7 +2491,7 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event,
if (event->type() == QEvent::MouseButtonRelease && !event->buttons())
*buttonDown = 0;
}
- } else if (lastMouseReceiver) {
+ } else if (lastMouseReceiver && widgetUnderMouse) {
// Dispatch enter/leave if we move:
// 1) from an alien widget to another alien widget or
// from a native widget to an alien widget (first OR case)