summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-09 08:44:06 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-09-18 12:54:51 (GMT)
commit22b350f9916947ead9c0db6d942ac5ba03ea4ca8 (patch)
tree289bdce8e1323bfe939f4a0a1a67603419b224f2 /src/gui/kernel
parent2b0f2c1c8452c16723a15f00117c96c57bb017a8 (diff)
downloadQt-22b350f9916947ead9c0db6d942ac5ba03ea4ca8.zip
Qt-22b350f9916947ead9c0db6d942ac5ba03ea4ca8.tar.gz
Qt-22b350f9916947ead9c0db6d942ac5ba03ea4ca8.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')
-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);