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

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.3, 5.14.0 Alpha
    • 5.11.1
    • QPA
    • None
    • macOS
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            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