Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1, 5.3.0
-
Linux only, XCB on GNOME/XFCE only (works in KDE)
-
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
Issue Links
- duplicates
-
QTBUG-31117 showNormal() on a minimized dialog doesn't restore the dialog on the screen, Qt 5 regression on Mac & Linux
- Closed