diff options
author | Kevin Ottens <kevin.ottens.qnx@kdab.com> | 2012-05-22 13:08:27 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-24 14:47:20 +0200 |
commit | 425c902ed0e2d11f14be9a2e53ee207fab21ae9e (patch) | |
tree | accd7fb8c79506e5b25d843ebc0e7f8643cb2668 /src | |
parent | b2832137129f4c7b66eadffb8b8aeee8486ac73b (diff) |
QNX: Recreate EGL surface when the window geometry changes
Change-Id: Ic578e9c3f4d8f70bcac0d95f59942cd2724aee51
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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. |