Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.12.3, 5.12
-
None
Description
To reproduce this issue need to have two or more monitors.
QMessageBox disables menu bar actions on the first appearance, but after moving it to another screen - actions become enabled again (on the origin screen).
Steps to reproduce:
- Run attached example.
- Click the button and check menu bar items are disabled.
- Move message box to another screen (do not close it) - check menu bar items on the main window screen is enabled.
The menu bar options become enabled while the message box is currently shown.
Attached screen record with the issue scenario.
Is it correct behavior? There is a peace of code in qt5/qtbase/src/plugins/platforms/cocoa/qnsview_menus.mm:
// Check if a modal dialog is active. Validate only menu // items belonging to this view's window own menu bar. if (QGuiApplication::modalWindow()) { QCocoaMenuBar *menubar = nullptr; QObject *menuParent = platformItem->menuParent(); while (menuParent && !(menubar = qobject_cast<QCocoaMenuBar *>(menuParent))) { auto *menuObject = dynamic_cast<QCocoaMenuObject *>(menuParent); menuParent = menuObject->menuParent(); } if (menubar && menubar->cocoaWindow() != self.platformWindow) return NO; }
Looks like it's a defined case, but it breaks modality as described above.