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>
This commit is contained in:
Kevin Ottens 2012-05-22 13:08:27 +02:00 committed by Qt by Nokia
parent b283213712
commit 425c902ed0

View File

@ -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.