From 6f85819fdcdc508410d7a271d648dd558a1a1b51 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 7 Mar 2013 14:09:17 +0100 Subject: 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 --- src/controls/qtmenu.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/controls/qtmenu.cpp') 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(topMenuWindow->transientParent()); + if (!pw) + topMenuWindow->dismissMenu(); + topMenuWindow = pw; + } } void QtMenu::windowVisibleChanged(bool v) -- cgit v1.2.3