diff options
author | Gabriel de Dietrich <[email protected]> | 2013-03-13 17:08:35 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-03-13 18:01:51 +0100 |
commit | 4744783c3da4912fdfb2bdf4c5f91a445892d325 (patch) | |
tree | b0fdd1409a58c9c7583ea766663f7c0606e68aa1 | |
parent | 69b773c2ec5c3dfcd2d2f4b1136884de7585e742 (diff) |
Menu: Ungrab mouse from mouse grabber when showing popup
Change-Id: I41fa2cb39ba8ec6ba2a5ccd68d9d53d6b2f2e543
Reviewed-by: J-P Nurmi <[email protected]>
-rw-r--r-- | src/controls/qtmenu.cpp | 4 |
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() |