summaryrefslogtreecommitdiffstats
path: root/src/controls/qtmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/controls/qtmenu.cpp')
-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()