summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2010-12-09 09:51:01 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-12-09 09:51:01 (GMT)
commit4ecc45086102807901a3bd2b9e02a169ca212716 (patch)
tree80ca036b6789c58736cfd6dc03f9c10086d5d878 /src/gui/kernel
parent14aea84dd16bd9778cdc5803fdfa3523d9282411 (diff)
downloadQt-4ecc45086102807901a3bd2b9e02a169ca212716.zip
Qt-4ecc45086102807901a3bd2b9e02a169ca212716.tar.gz
Qt-4ecc45086102807901a3bd2b9e02a169ca212716.tar.bz2
Fix a rare race condition when showing windows
When setting a window to translucent shortly before showing it with the OpenGL graphics system, the hijacking would call XDestroyWindow without resetting the internal state. This might lead to the window waiting for a map notify message forever. The patch now properly resets the internal state when destroying the old window, so it'll get mapped correctly when show() is called. Reviewed-by: Denis Dzyubenko
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwidget_x11.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 9085e98..ff6f215 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -905,8 +905,17 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
inputContext->setFocusWidget(q);
}
- if (destroyw)
+ if (destroyw) {
qt_XDestroyWindow(q, dpy, destroyw);
+ if (QTLWExtra *topData = maybeTopData()) {
+#ifndef QT_NO_XSYNC
+ if (topData->syncUpdateCounter)
+ XSyncDestroyCounter(dpy, topData->syncUpdateCounter);
+#endif
+ // we destroyed our old window - reset the top-level state
+ createTLSysExtra();
+ }
+ }
// newly created windows are positioned at the window system's
// (0,0) position. If the parent uses wrect mapping to expand the