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

xcb: no activeWindow after closing a modal dialog

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.2, 5.10.1
    • None
    • gnome (X11)

    Description

      #include <QApplication>
      #include <QDebug>
      #include <QMessageBox>
      #include <QPushButton>
      #include <QThread>
      #include <QVBoxLayout>
      #include <QWidget>
      
      int main(int argc, char * argv[]) {
      	QApplication qapp(argc, argv);
      	QWidget widget;
      	widget.setLayout(new QVBoxLayout);
      	QPushButton button;
      	widget.layout()->addWidget(&button);
      	widget.show();
      	QObject::connect(&button, &QPushButton::clicked, [&widget](){
      		qDebug() << QApplication::activeWindow();
      		QMessageBox box;
      		box.exec();
      		qDebug() << QApplication::activeWindow();
      		QCoreApplication::processEvents();
      		widget.activateWindow();// QThread::msleep(10);// works also
      		QCoreApplication::processEvents();
      		qDebug() << QApplication::activeWindow();
      		exit(0);
      	});
      	return qapp.exec();
      }
      

      prints

      QWidget(0x7ffedb9aae30)
      QWidget(0x0)
      QWidget(0x7ffedb9aae30)
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            darklighter Norbert Pfeiler
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes