diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index dd5d0c476c..6387193aba 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -188,6 +188,22 @@ void QQnxWindow::setGeometry(const QRect &rect) qFatal("QQnxWindow: failed to set window source size, errno=%d", errno); } + if (m_platformOpenGLContext != 0 && bufferSize() != rect.size()) { + bool restoreCurrent = false; + + if (m_platformOpenGLContext->isCurrent()) { + m_platformOpenGLContext->doneCurrent(); + restoreCurrent = true; + } + + m_platformOpenGLContext->destroySurface(); + setBufferSize(rect.size()); + m_platformOpenGLContext->createSurface(this); + + if (restoreCurrent) + m_platformOpenGLContext->makeCurrent(this); + } + QWindowSystemInterface::handleGeometryChange(window(), rect); // Now move all children.