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

Switching to/from fullscreen from maximized window shows wrong

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 5.5.1
    • GUI: Window management
    • None
    • Windows 10 64bit

    Description

      When a window is maximized and I repeatedly go to full screen and back, after the first or second time the full screen shows some kind of glitch. Suddenly you can see windows 7 window decorations at the side of the window (I'm on windows 10).

      The code to reproduce it is attached below. It is just the default QMainWindow application with a function to toggle full screen when the key 'F' is pressed.

      The issue can be reproduced as follows:

      • Maximize the MainWindow (the maximize button on the top right)
      • press F, F, F, F, F to go to full screen, back, and to full screen again and back and to full screen

      A screen shot of how it looks on my maschine is attached.

      main.cpp
      #include "mainwindow.h"
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
      
          return a.exec();
      }
      
      mainwindow.h
      #ifndef MAINWINDOW_H
      #define MAINWINDOW_H
      
      #include <QMainWindow>
      #include <QKeyEvent>
      
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          explicit MainWindow(QWidget *parent = 0) : QMainWindow(parent) {}
          ~MainWindow() {}
      
      protected:
          virtual void keyPressEvent( QKeyEvent * event )
          {
              if (event->key() == Qt::Key_F)
              {
                  setWindowState(windowState() ^ Qt::WindowFullScreen);
              }
          }
      };
      
      #endif // MAINWINDOW_H
      

      Attachments

        1. FullScreenBug.png
          FullScreenBug.png
          4 kB
        2. qtbug53577_diag.diff
          9 kB
        3. qtbug53577_log.txt
          33 kB
        4. qtbug53577.zip
          2 kB

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              ChristianFeldmann Christian Feldmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes