summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-16 14:22:31 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-17 13:46:41 (GMT)
commitfb6cfbe48bc4f2148062d50d4df95616e06f9324 (patch)
tree468b53299ac3c9be3ab08bfac1c6815f902cfabc
parent0ca8f2b116a01323b40c139a014f955e30b2acd3 (diff)
downloadQt-fb6cfbe48bc4f2148062d50d4df95616e06f9324.zip
Qt-fb6cfbe48bc4f2148062d50d4df95616e06f9324.tar.gz
Qt-fb6cfbe48bc4f2148062d50d4df95616e06f9324.tar.bz2
Improved qt_x11_wait_for_window_manager
We shouldn't really care about ReparentNotify when waiting for a window to be "managed" by the window manager. We only need to wait until the window is Mapped and Exposed for the first time, then we (most likely) can safely assume that the window manager has finished managing the window. Task-number: QTBUG-9097 Reviewed-by: Bradley T. Hughes
-rw-r--r--src/gui/kernel/qwidget_x11.cpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index b4febc6..ece4be4 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -369,7 +369,7 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
// ConfigureNotify ... MapNotify ... Expose
enum State {
- Initial, Reparented, Mapped
+ Initial, Mapped
} state = Initial;
do {
@@ -377,33 +377,15 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
XNextEvent(X11->display, &ev);
qApp->x11ProcessEvent(&ev);
- if (w->windowFlags() & Qt::X11BypassWindowManagerHint) {
- switch (state) {
- case Initial:
- case Reparented:
- if (ev.type == MapNotify && ev.xany.window == winid)
- state = Mapped;
- break;
- case Mapped:
- if (ev.type == Expose && ev.xany.window == winid)
- return;
- break;
- }
- } else {
- switch (state) {
- case Initial:
- if (ev.type == ReparentNotify && ev.xany.window == winid)
- state = Reparented;
- break;
- case Reparented:
- if (ev.type == MapNotify && ev.xany.window == winid)
- state = Mapped;
- break;
- case Mapped:
- if (ev.type == Expose && ev.xany.window == winid)
- return;
- break;
- }
+ switch (state) {
+ case Initial:
+ if (ev.type == MapNotify && ev.xany.window == winid)
+ state = Mapped;
+ break;
+ case Mapped:
+ if (ev.type == Expose && ev.xany.window == winid)
+ return;
+ break;
}
} else {
if (!XEventsQueued(X11->display, QueuedAfterFlush))