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

QApplication::processEvents hangs when QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM is defined

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3
    • QPA
    • None
    • Apple M1 pro
      macOS Ventura 13.6.1
    • macOS

    Description

      When defining QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM to prevent the app to show up in the dock on macOS, further calls to QApplication::processEvents() will hangs.

      #include <QApplication>
      #include <QTimer>
      
      int main(int ac, char** av)
      {
          // prevent focus stealing
          qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "1");
      
          auto application = QApplication(ac, av);
          QApplication::processEvents();
      }
      

      The application look stuck in QCocoaEventDispatcher::ensureNSAppInitialized

      qt.eventdispatcher: Ensuring NSApplication is initialized
      qt.eventdispatcher: NSApplication has been initialized; Stopping NSApp
      

      This function was updated in https://codereview.qt-project.org/c/qt/qtbase/+/443326

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            paul.barbot Paul Barbot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes