void tst_QWidget_window::tst_showWithoutActivating() { #ifndef Q_WS_X11 QSKIP("This test is X11-only.", SkipAll); #else QWidget w; w.show(); QTest::qWaitForWindowShown(&w); QApplication::processEvents(); QApplication::clipboard(); QLineEdit *lineEdit = new QLineEdit; lineEdit->setAttribute(Qt::WA_ShowWithoutActivating, true); lineEdit->show(); lineEdit->setAttribute(Qt::WA_ShowWithoutActivating, false); lineEdit->raise(); lineEdit->activateWindow(); Window window; int revertto; QTRY_COMPARE(lineEdit->winId(), (XGetInputFocus(QX11Info::display(), &window, &revertto), window) ); // Note the use of the , before window because we want the XGetInputFocus to be re-executed // in each iteration of the inside loop of the QTRY_COMPARE macro #endif // Q_WS_X11 }