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 Pick-to: 6.0 5.15 Change-Id: Ifb9c3fe12654b2972e0e3c368dc093fae1ed4cc8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
8f9222db3b
commit
115bcdb862
@ -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