summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_x11.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-09 08:44:06 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-09 09:25:06 (GMT)
commit36ec92315aaf9f155fc12fd09d1fa7d80338a2b8 (patch)
tree9e120225dff291dfa0c7cddb945561ff03273d07 /src/gui/kernel/qwidget_x11.cpp
parent62d08b6720dd6dd871266d612cb1e2b8b651b25e (diff)
downloadQt-36ec92315aaf9f155fc12fd09d1fa7d80338a2b8.zip
Qt-36ec92315aaf9f155fc12fd09d1fa7d80338a2b8.tar.gz
Qt-36ec92315aaf9f155fc12fd09d1fa7d80338a2b8.tar.bz2
More robust implementation of qt_x11_wait_for_window_manager
Make sure we recieve both ReparentNotify and MapNotify events. Also change the timeout to 2 seconds to cope with slow machines Reviewed-by: Denis
Diffstat (limited to 'src/gui/kernel/qwidget_x11.cpp')
-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);