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

Closing a full screen QMainWindow leaves the screen black on macOS if there are multiple instances of QMainWindow created

    XMLWordPrintable

    Details

    • Platform/s:
      macOS

      Description

      The code snippet attached can be used to reproduce the issue

      #include <QApplication>
      #include <QMainWindow>
      #include <QAction>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          auto w = new QMainWindow;
          w->show();
          auto w2 = new QMainWindow;
          w2->show();
      
          auto closeActionW = new QAction(w);
          closeActionW->setShortcut(QKeySequence("Ctrl+W"));
          w->addAction(closeActionW);
          QObject::connect(closeActionW, &QAction::triggered, w, [w]() { w->close(); });
      
          auto closeActionW2 = new QAction(w2);
          closeActionW2->setShortcut(QKeySequence("Ctrl+W"));
          w2->addAction(closeActionW2);
          QObject::connect(closeActionW2, &QAction::triggered, w2, [w2]() { w2->close(); });
      
          return a.exec();
      }
      

      Steps to reproduce:
      1. Build and run the example attached.
      2. Press the full screen button (green) in the window title bar.
      3. Press cmd-w to close the window.

      Expected result:
      The window is closed and the dashboard changes to the "main" one

      Actual result:
      The window is closed and the dashboard is shown black, doesn't return to the "main" dashboard. (use cmd+tab to switch the dashboard).

        Attachments

        1. QTBUG-46701.patch
          1 kB
        2. QTBUG-46701.tar.gz
          0.7 kB

          Issue Links

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

            Activity

              People

              • Assignee:
                sorvig Morten Sørvig
                Reporter:
                qtcomsupport Qt Support
              • Votes:
                17 Vote for this issue
                Watchers:
                25 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes