From d429d65628da8c60907ead7e0c8250abc7ac6695 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Wed, 21 Nov 2012 09:52:05 +0000 Subject: QNX: Fix crash due to re-entering QToolTip::show(). The flushWindowSystemEvents() was added to send the geometry event synchronously. A side effect was that all input events were also sent. We don't want that. We're probably in setGeometry() because some other input event brought us here, and it's still in the call stack. One crashy example is the static method QToolTip::show() which uses static variables([1]). If we process input events while the first QToolTip::show() is still on the call stack, it will trigger a second one, deleting stuff ([1]) that the first invocation will still need once the stack unwinds. Change-Id: Iea22419a7f386d6b6231404666092340dfd1afed Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qqnxwindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index c668a8867d..166cb499b0 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -179,9 +179,13 @@ void QQnxWindow::setGeometry(const QRect &rect) m_platformOpenGLContext->requestSurfaceChange(); } - // Send a geometry change event to Qt (triggers resizeEvent() in QWindow/QWidget) + // Send a geometry change event to Qt (triggers resizeEvent() in QWindow/QWidget). + + // Calling flushWindowSystemEvents() here would flush input events which + // could result in re-entering QQnxWindow::setGeometry() again. + QWindowSystemInterface::setSynchronousWindowsSystemEvents(true); QWindowSystemInterface::handleGeometryChange(window(), rect); - QWindowSystemInterface::flushWindowSystemEvents(); + QWindowSystemInterface::setSynchronousWindowsSystemEvents(false); // Now move all children. if (!oldGeometry.isEmpty()) { -- cgit v1.2.3