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

XCB: isMinimized() returns wrong status

    XMLWordPrintable

    Details

    • Commits:
      382b7afbe253c29499631066bbe1091f0afbd386

      Description

      isWindow()returs false even in case window is already minimized. Actually After each WindowStateChange Qt::WindowMinimized, it automatically fires previous window State which negates the actual state.

      Following example can shows it. You can see two output for every minimize event.

      #include <QtWidgets>
      
      static QString windowStateString(Qt::WindowStates states)
      {
          QStringList str;
          if (states & Qt::WindowMinimized)
              str += "Qt::WindowMinimized";
          if (states & Qt::WindowMaximized)
              str += "Qt::WindowMaximized";
          if (states & Qt::WindowFullScreen)
              str += "Qt::WindowFullScreen";
          if (states & Qt::WindowActive)
              str += "Qt::WindowActive";
          if (states == Qt::WindowNoState)
              str += "Qt::WindowNoState";
          return str.join(",");
      }
      
      class Window : public QWidget
      {
      protected:
          void changeEvent(QEvent *event)
          {
              QWidget::changeEvent(event);
              if (event->type() == QEvent::WindowStateChange){
                  setWindowTitle(windowStateString(windowState()));
                  qDebug()<<isMinimized();
              }
          }
      };
      
      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
          Window w;
          w.showMaximized();
          return app.exec();
      }
      
      

        Attachments

        1. MinimizeWindow.zip
          2 kB
        2. qtbug39376.zip
          1 kB

          Issue Links

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

            Activity

              People

              • Assignee:
                srutledg Shawn Rutledge
                Reporter:
                qtcomsupport Qt Support
              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes