diff options
author | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2010-04-21 05:50:25 (GMT) |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2010-04-21 05:50:25 (GMT) |
commit | e46aeaf529be4598d809417e74ac09de4170465f (patch) | |
tree | da5d677d66b0cdef456bd1a40ab63b1a0b1e363c /src/gui/widgets | |
parent | cde95eb6e0856d22e1528b2c731b876be0c71d8e (diff) | |
download | Qt-e46aeaf529be4598d809417e74ac09de4170465f.zip Qt-e46aeaf529be4598d809417e74ac09de4170465f.tar.gz Qt-e46aeaf529be4598d809417e74ac09de4170465f.tar.bz2 |
Revert "Default (Parentless) QMenuBar actions do not work"
This reverts commit 327fabf8e8819b199aa24912ffe6893020b465d4.
Test Failures:
macnativeevents::testMenuBarWorksForModalDialog (pulse_macx-g++_cocoa_32)
macnativeevents::testMenuBarWorksWithoutWindows (pulse_macx-g++_cocoa_32)
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 7645c23..6a0eb53 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -665,7 +665,6 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo } } #else - bool modalWindowOnScreen = qApp->activeModalWidget() != 0; for (NSMenuItem *item in [menu itemArray]) { OSMenuRef submenu = [item submenu]; if (submenu != merge) { @@ -675,20 +674,10 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo // The item should follow what the QAction has. if ([item tag]) { QAction *action = reinterpret_cast<QAction *>([item tag]); - syncNSMenuItemEnabled(item, action->isEnabled()); - } else { - syncNSMenuItemEnabled(item, YES); - } - // We sneak in some extra code here to handle a menu problem: - // If there is no window on screen, we cannot set 'nil' as - // menu item target, because then cocoa will disable the item - // (guess it assumes that there will be no first responder to - // catch the trigger anyway?) OTOH, If we have a modal window, - // then setting the menu loader as target will make cocoa not - // deliver the trigger because the loader is then seen as modally - // shaddowed). So either way there are shortcomings. Instead, we - // decide the target as late as possible: - [item setTarget:modalWindowOnScreen ? nil : getMenuLoader()]; + syncNSMenuItemEnabled(item, action->isEnabled()); + } else { + syncNSMenuItemEnabled(item, YES); + } } else { syncNSMenuItemEnabled(item, NO); } |