summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel de Dietrich <[email protected]>2013-03-13 17:08:35 +0100
committerThe Qt Project <[email protected]>2013-03-13 18:01:51 +0100
commit4744783c3da4912fdfb2bdf4c5f91a445892d325 (patch)
treeb0fdd1409a58c9c7583ea766663f7c0606e68aa1
parent69b773c2ec5c3dfcd2d2f4b1136884de7585e742 (diff)
Menu: Ungrab mouse from mouse grabber when showing popup
-rw-r--r--src/controls/qtmenu.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/controls/qtmenu.cpp b/src/controls/qtmenu.cpp
index ca1d3e107..0fe475724 100644
--- a/src/controls/qtmenu.cpp
+++ b/src/controls/qtmenu.cpp
@@ -261,6 +261,10 @@ void QtMenu::__popup(qreal x, qreal y, int atItemIndex)
qreal initialWidth = qMax(qreal(1), m_menuContentItem->width());
qreal initialHeight = qMax(qreal(1), m_menuContentItem->height());
+ if (!qobject_cast<QtMenuPopupWindow *>(parentWindow)) // No need for parent menu windows
+ if (QQuickItem *mg = parentWindow->mouseGrabberItem())
+ mg->ungrabMouse();
+
m_popupWindow->setGeometry(x, y, initialWidth, initialHeight);
m_popupWindow->show();
m_popupWindow->setMouseGrabEnabled(true); // Needs to be done after calling show()