From 7ff70350f485f815bbcb2412631b636485ebe37d Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 28 May 2009 10:35:43 +0200 Subject: Send ParentChanged event to QGLWidgets when the wId changes on EGL EGL has window surfaces which are bound to a particular window ID. When that window ID changes, the EGL surface must be re-created. This is achieved by sending the QGLWidget a ParentChanged event. Reviewed-By: Trond --- src/gui/kernel/qwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index d6e5cce..5538c11 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -9203,11 +9203,12 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) d->resolveLayoutDirection(); d->resolveLocale(); - // Note: GL widgets under Windows will always need a ParentChange - // event to handle recreation/rebinding of the GL context, hence - // the (f & Qt::MSWindowsOwnDC) clause + // Note: GL widgets under WGL or EGL will always need a ParentChange + // event to handle recreation/rebinding of the GL context, hence the + // (f & Qt::MSWindowsOwnDC) clause (which is set on QGLWidgets on all + // platforms). if (newParent -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(QT_OPENGL_ES) || (f & Qt::MSWindowsOwnDC) #endif ) { -- cgit v0.12