summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/controls/qtmenu.cpp9
-rw-r--r--src/controls/qtmenupopupwindow.cpp7
2 files changed, 10 insertions, 6 deletions
diff --git a/src/controls/qtmenu.cpp b/src/controls/qtmenu.cpp
index d2c7e863e..688ecb65a 100644
--- a/src/controls/qtmenu.cpp
+++ b/src/controls/qtmenu.cpp
@@ -300,8 +300,13 @@ void QtMenu::__closeMenu()
void QtMenu::__dismissMenu()
{
- if (m_popupWindow)
- m_popupWindow->dismissMenu();
+ QtMenuPopupWindow *topMenuWindow = m_popupWindow;
+ while (topMenuWindow) {
+ QtMenuPopupWindow *pw = qobject_cast<QtMenuPopupWindow *>(topMenuWindow->transientParent());
+ if (!pw)
+ topMenuWindow->dismissMenu();
+ topMenuWindow = pw;
+ }
}
void QtMenu::windowVisibleChanged(bool v)
diff --git a/src/controls/qtmenupopupwindow.cpp b/src/controls/qtmenupopupwindow.cpp
index 74534c2dd..64fdd11f3 100644
--- a/src/controls/qtmenupopupwindow.cpp
+++ b/src/controls/qtmenupopupwindow.cpp
@@ -86,7 +86,7 @@ void QtMenuPopupWindow::setParentWindow(QQuickWindow *parentWindow)
if (parentWindow) {
connect(parentWindow, SIGNAL(destroyed()), this, SLOT(dismissMenu()));
if (QtMenuPopupWindow *pw = qobject_cast<QtMenuPopupWindow *>(parentWindow))
- connect(this, SIGNAL(menuDismissed()), pw, SLOT(dismissMenu()));
+ connect(pw, SIGNAL(menuDismissed()), this, SLOT(dismissMenu()));
}
}
@@ -106,7 +106,7 @@ void QtMenuPopupWindow::setGeometry(int posx, int posy, int w, int h)
}
if (posy + h > s.height())
- posy = s.height() - h;
+ posy = s.height() - h;
else if (posy < 0)
posy = 0;
@@ -115,9 +115,8 @@ void QtMenuPopupWindow::setGeometry(int posx, int posy, int w, int h)
void QtMenuPopupWindow::dismissMenu()
{
- close();
-
emit menuDismissed();
+ close();
}
void QtMenuPopupWindow::updateSize()