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

QWidget::isActiveWindow() returns true for minimized windows on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.7.1, 4.7.2, 4.7.3
    • None
    • Windows 7 x64, Windows XP, MinGW 4.4

    Description

      I'm compiling my Qt app on Windows 7 using Qt 4.7.2 and MinGW 4.4. I use QWidget::isActiveWindow() and it turns out that when I minimize a window by clicking on its entry in the taskbar, Qt thinks the window is still active but at the same time it knows it's minimized. I reproduced this issue also on Windows XP using Qt 4.7.1.

      The problem is easily reproducible in the following app. Note that minimizing the window by clicking on "_" button on its decoration gives correct results.

      #include <QtCore/QDebug>
      #include <QtCore/QTimer>
      #include <QtGui/QApplication>
      #include <QtGui/QWidget>
      
      class Widget : public QWidget}}
      {
      	Q_OBJECT
      
      	QTimer m_timer;
      
      public:
      	Widget()
      	{
      		m_timer.setInterval(500);
      		m_timer.setSingleShot(false);
      		connect(&m_timer, SIGNAL(timeout()), SLOT(onTimer()));
      		m_timer.start();
      	}
      
      public slots:
      	void onTimer()
      	{
      		qDebug() << "isActiveWindow():" << isActiveWindow()
      			<< ", isMinimized():" << isMinimized();
      	}
      };
      
      int main(int argc, char *argv[])
      {
      	QApplication app(argc, argv);
      	Widget w;
      	w.show();
      
      	return app.exec();
      }
      
      #include "moc_main.cxx"
      

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              beevvy Bartosz Brachaczek
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes