Cocoa: When validating menus, account for modal window only if active
When a modal window is WindowModal then it is possible for another top level window to be active and therefore the menus shown may be valid for the window. So we can still allow the menu items to be validated in the context of that window. Fixes: QTBUG-74088 Change-Id: Ifb9c3fe12654b2972e0e3c368dc093fae1ed4cc8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 115bcdb862ec52ebda04e1337f978096d8879e6d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b61275ee72
commit
e255716291
@ -73,9 +73,9 @@ static bool selectorIsCutCopyPaste(SEL selector)
|
||||
if (platformItem->menu())
|
||||
return YES;
|
||||
|
||||
// Check if a modal dialog is active. Validate only menu
|
||||
// items belonging to this view's window own menu bar.
|
||||
if (QGuiApplication::modalWindow()) {
|
||||
// Check if a modal dialog is active. If so, enable only menu
|
||||
// items explicitly belonging to this window's own menu bar.
|
||||
if (QGuiApplication::modalWindow() && QGuiApplication::modalWindow()->isActive()) {
|
||||
QCocoaMenuBar *menubar = nullptr;
|
||||
|
||||
QObject *menuParent = platformItem->menuParent();
|
||||
@ -84,7 +84,6 @@ static bool selectorIsCutCopyPaste(SEL selector)
|
||||
menuParent = menuObject->menuParent();
|
||||
}
|
||||
|
||||
// we have no menubar parent for the application menu items, e.g About and Preferences
|
||||
if (!menubar || menubar->cocoaWindow() != self.platformWindow)
|
||||
return NO;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user