diff options
| author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-03-07 14:09:17 +0100 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-11 12:49:41 +0100 |
| commit | 6f85819fdcdc508410d7a271d648dd558a1a1b51 (patch) | |
| tree | 683e06b9bcce501b7bed31cc9ba8267a76e67938 /src/controls/qtmenu.cpp | |
| parent | b19f991a2c1fb9f0ce3ce833b55a0d11d8077032 (diff) | |
Menu: Make popup menus close from child to parent
Some window managers use fading effects to close popups, resulting on
an unnatural animation if menus close from parent to child.
Change-Id: I5860b65b2905752f74c8abdad05988980c167323
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/qtmenu.cpp')
| -rw-r--r-- | src/controls/qtmenu.cpp | 9 |
1 files changed, 7 insertions, 2 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) |
