diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-02-05 15:59:33 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-02-05 16:03:13 (GMT) |
commit | 2bc5d161e6820d459f00ac687ed99830a731cb74 (patch) | |
tree | 3e26ff6108f2305cee265f4895fe00dff935f54c | |
parent | fb8d0593198313b975ed6c0c9ba99624d1d1fbec (diff) | |
download | Qt-2bc5d161e6820d459f00ac687ed99830a731cb74.zip Qt-2bc5d161e6820d459f00ac687ed99830a731cb74.tar.gz Qt-2bc5d161e6820d459f00ac687ed99830a731cb74.tar.bz2 |
Fixed qt_x11_wait_for_window_manager
When we wait for the window to be shown by looking for ReparentNotify,
MapNotify, etc events in the event queue, we should check if those events come
for the right window, otherwise we might exit too early if there are event for
an other window in the queue.
Reviewed-by: Leonardo Sobral Cunha
-rw-r--r-- | src/gui/kernel/qwidget_x11.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 007de7f..10fb009 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -358,6 +358,8 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w) if (!w->testAttribute(Qt::WA_WState_Created)) return; + WId winid = w->internalWinId(); + // first deliver events that are already in the local queue QApplication::sendPostedEvents(); @@ -379,26 +381,26 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w) switch (state) { case Initial: case Reparented: - if (ev.type == MapNotify) + if (ev.type == MapNotify && ev.xany.window == winid) state = Mapped; break; case Mapped: - if (ev.type == Expose) + if (ev.type == Expose && ev.xany.window == winid) return; break; } } else { switch (state) { case Initial: - if (ev.type == ReparentNotify) + if (ev.type == ReparentNotify && ev.xany.window == winid) state = Reparented; break; case Reparented: - if (ev.type == MapNotify) + if (ev.type == MapNotify && ev.xany.window == winid) state = Mapped; break; case Mapped: - if (ev.type == Expose) + if (ev.type == Expose && ev.xany.window == winid) return; break; } |