From b1141eaa833cfada0d10f68017fb329e68c04869 Mon Sep 17 00:00:00 2001
From: Filippo Cucchetto <filippocucchetto@gmail.com>
Date: Wed, 19 Nov 2014 19:36:26 +0100
Subject: [PATCH] Fixed missing mouse event when the Menu control is dismissed

The QQuickPopupWindow doesn't forward the mouse event to the transient window
if the menu is dismissed

Task-number: QTBUG-40391
Change-Id: I2e5fd8b64c63d005445f9fd5e8b36e47b04c1e8b
Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
---
 src/controls/qquickpopupwindow.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/controls/qquickpopupwindow.cpp b/src/controls/qquickpopupwindow.cpp
index 70b27758e..fa7ebee1e 100644
--- a/src/controls/qquickpopupwindow.cpp
+++ b/src/controls/qquickpopupwindow.cpp
@@ -180,7 +180,8 @@ void QQuickPopupWindow::forwardEventToTransientParent(QMouseEvent *e)
             || e->type() == QEvent::MouseButtonPress)) {
         // Clicked outside any popup
         dismissPopup();
-    } else if (transientParent()) {
+    }
+    if (transientParent()) {
         QPoint parentPos = transientParent()->mapFromGlobal(mapToGlobal(e->pos()));
         QMouseEvent pe = QMouseEvent(e->type(), parentPos, e->button(), e->buttons(), e->modifiers());
         QGuiApplication::sendEvent(transientParent(), &pe);
-- 
GitLab