summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qapplication.h1
-rw-r--r--src/gui/kernel/qwidgetwindow_qpa.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index b045dc3788..fc0ab644a0 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 3e062892fa..e02c2cf639 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;