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

Mac: QCocoaIntegration doesn't listen to Screen changes if running in AA_PluginApplication mode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.11.1
    • Fix Version/s: 5.12.3, 5.14.0 Alpha
    • Component/s: QPA
    • Labels:
      None
    • Platform/s:
      macOS
    • Commits:
      10565c5ef32457443cc950c26e2d8fab6941dac1 (qt/qtbase/5.12)

      Description

      The Screen change listener logic is coded as part of QCocoaApplicationDelegate. The problem is QCocoaIntegration doesn't initialize a QCocoaApplicationDelegate if we're running in AA_PluginApplication.

      This makes sense if we don't want the Qt Menu or the custom delegate methods, but we ALWAYS want to keep the list of QScreens in sync with the screens in OS, otherwise functions like QWindow::setGeometry will fail when pluging in new displays/projects while the application is running.

      // ### For AA_MacPluginApplication we don't want to load the menu nib.
      // Qt 4 also does not set the application delegate, so that behavior
      // is matched here.
      if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication))

      { // Set app delegate, link to the current delegate (if any) QCocoaApplicationDelegate *newDelegate = [QCocoaApplicationDelegate sharedDelegate]; [newDelegate setReflectionDelegate:[cocoaApplication delegate]]; [cocoaApplication setDelegate:newDelegate]; // Load the application menu. This menu contains Preferences, Hide, Quit. QCocoaMenuLoader *qtMenuLoader = [QCocoaMenuLoader sharedMenuLoader]; [cocoaApplication setMenu:[qtMenuLoader menu]]; }

        Attachments

        For Gerrit Dashboard: QTBUG-72966
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            vestbo Tor Arne Vestbø
            Reporter:
            cosminp Cosmin Pancratov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes