From e6af684ee48ef44befb3fedaecbe417eaf049b4f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20R=C3=B8dal?= Date: Wed, 4 May 2011 14:35:24 +0200 Subject: [PATCH] Closing of popups in QWidgetWindow. --- src/gui/kernel/qapplication.h | 1 + src/gui/kernel/qwidgetwindow_qpa.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index b045dc3..fc0ab64 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -389,6 +389,7 @@ private: friend class QGraphicsScenePrivate; friend class QWidget; friend class QWidgetPrivate; + friend class QWidgetWindow; friend class QETWidget; friend class Q3AccelManager; friend class QTranslator; diff --git a/src/gui/kernel/qwidgetwindow_qpa.cpp b/src/gui/kernel/qwidgetwindow_qpa.cpp index 3e06289..e02c2cf 100644 --- a/src/gui/kernel/qwidgetwindow_qpa.cpp +++ b/src/gui/kernel/qwidgetwindow_qpa.cpp @@ -112,7 +112,10 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) // which child should have it? QWidget *widget = m_implicit_mouse_grabber ? m_implicit_mouse_grabber.data() : m_widget->childAt(event->pos()); - // TODO: make sure mouse release is delivered to same widget that got the press event + if (qApp->d_func()->inPopupMode()) { + widget = qApp->activePopupWidget(); + m_implicit_mouse_grabber.clear(); + } if (!widget) widget = m_widget; -- 2.7.4