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

      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

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes