From fb2296e84379b03176a52527ec956cd9b34dc058 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Wed, 5 Aug 2009 20:12:03 +0200 Subject: Fix QGLWidget::showFullScreen() on X11/EGL It seems the winId can change during a WindowStateChange event too. Reviewed-By: Trustme --- src/opengl/qgl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index af807dd..d3c0bf1 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3373,12 +3373,15 @@ bool QGLWidget::event(QEvent *e) setContext(new QGLContext(d->glcx->requestedFormat(), this)); // ### recreating the overlay isn't supported atm } + } + #if defined(QT_OPENGL_ES) - // The window may have been re-created during re-parent - if so, the EGL + if ((e->type() == QEvent::ParentChange) || (e->type() == QEvent::WindowStateChange)) { + // The window may have been re-created during re-parent or state change - if so, the EGL // surface will need to be re-created. d->recreateEglSurface(false); -#endif } +#endif #elif defined(Q_WS_WIN) if (e->type() == QEvent::ParentChange) { QGLContext *newContext = new QGLContext(d->glcx->requestedFormat(), this); -- cgit v0.12