diff options
Diffstat (limited to 'src')
-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); } |