summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
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-19 09:53:13 (GMT)
commitae42acb65c67afc9c48744057cf75de151a91f15 (patch)
tree3a2cdd604b8883da0d48286c09f014e3b85c9d1a /src/gui/kernel
parent7f52cac95b1e83cb9f5d9a9952c001688ea5bb8a (diff)
downloadQt-ae42acb65c67afc9c48744057cf75de151a91f15.zip
Qt-ae42acb65c67afc9c48744057cf75de151a91f15.tar.gz
Qt-ae42acb65c67afc9c48744057cf75de151a91f15.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 (cherry picked from commit fb6cfbe48bc4f2148062d50d4df95616e06f9324)
Diffstat (limited to 'src/gui/kernel')
-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 10fb009..9660de5 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))