summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qwidget_x11.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 43a6bad..58fb3e8d 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -358,12 +358,17 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
if (!w->testAttribute(Qt::WA_WState_Created))
return;
while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ReparentNotify, &ev)) {
- if (XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev))
- break;
- if (t.elapsed() > 500)
- return; // give up, no event available
+ if (t.elapsed() > 2000)
+ return;
qApp->syncX(); // non-busy wait
}
+
+ while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) {
+ if (t.elapsed() > 2000)
+ return;
+ qApp->syncX(); // non-busy wait
+ }
+
qApp->x11ProcessEvent(&ev);
if (XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ConfigureNotify, &ev))
qApp->x11ProcessEvent(&ev);