Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75821

MacOS: Modality is broken with menu bar actions when moving modal window to another screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.12.3, 5.12
    • None
    • macOS

    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.

      Attachments

        1. qtbug.zip
          5 kB
        2. qtbug-75821.mov
          7.88 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            pavloshyba Pavlo Shyba
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes