From 425c902ed0e2d11f14be9a2e53ee207fab21ae9e Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Tue, 22 May 2012 13:08:27 +0200 Subject: QNX: Recreate EGL surface when the window geometry changes Change-Id: Ic578e9c3f4d8f70bcac0d95f59942cd2724aee51 Reviewed-by: Sean Harmer Reviewed-by: Nicolas Arnaud-Cormos --- src/plugins/platforms/qnx/qqnxwindow.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/plugins/platforms') 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. -- cgit v1.2.3