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

setWindowState(Qt::WindowFullScreen) and showMinimized() does not work correctly together when QWindowsWindowFunctions::setHasBorderInFullScreen is set

    XMLWordPrintable

Details

    • 5ed446102a74fc22a0d6d26f7112ca1c3721b43a (qtbase/5.9, 6.7.2017, 5.9.2)

    Description

      With the code

      class Widget : public QWidget
      {
      protected:
          bool event(QEvent *e) override
          {
              if (e->type() == QEvent::WinIdChange) {
                  if (const auto win_handle = windowHandle())
                      QWindowsWindowFunctions::setHasBorderInFullScreen(win_handle, true);
              }
              return QWidget::event(e);
          }
      };
      
      WWidget widget;
      widget->setWindowState(Qt::WindowFullScreen);
      widget->showMinimized();
      

      the window will not become full screen when unminimized on Windows, or rather that will not be the state the QWidget::windowState() returns after being unminimized. If QWindowsWindowFunctions::setHasBorderInFullScreen() is not used, it works as expected.

      A more elaborate example that demonstrates the issue is attached as fullscreen.cc.

      Attachments

        1. fullscreen.cc
          2 kB
        2. qtbug61595.zip
          2 kB

        Issue Links

          Activity

            People

              kleint Friedemann Kleint
              ts Thomas Sondergaard
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: