summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl_p.h8
-rw-r--r--src/opengl/qwindowsurface_gl.cpp25
-rw-r--r--src/opengl/qwindowsurface_gl_p.h1
3 files changed, 28 insertions, 6 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index df09dfd..89153d9 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -106,6 +106,10 @@ class QMacWindowChangeEvent;
class QWSGLWindowSurface;
#endif
+#ifdef Q_OS_SYMBIAN
+extern bool qt_initializing_gl_share_widget();
+#endif
+
#ifndef QT_NO_EGL
class QEglContext;
#endif
@@ -183,6 +187,10 @@ public:
#endif
{
isGLWidget = 1;
+#if defined(Q_OS_SYMBIAN)
+ if (qt_initializing_gl_share_widget())
+ isGLGlobalShareWidget = 1;
+#endif
}
~QGLWidgetPrivate() {}
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index a15084b..d512946 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -184,28 +184,29 @@ QGLGraphicsSystem::QGLGraphicsSystem(bool useX11GL)
class QGLGlobalShareWidget
{
public:
- QGLGlobalShareWidget() : widget(0), initializing(false) {
+ QGLGlobalShareWidget() : widget(0), init(false) {
created = true;
}
QGLWidget *shareWidget() {
- if (!initializing && !widget && !cleanedUp) {
- initializing = true;
+ if (!init && !widget && !cleanedUp) {
+ init = true;
widget = new QGLWidget(QGLFormat(QGL::SingleBuffer | QGL::NoDepthBuffer | QGL::NoStencilBuffer));
#ifdef Q_OS_SYMBIAN
if (!widget->context()->isValid()) {
delete widget;
widget = 0;
- initializing = false;
+ init = false;
return 0;
}
#endif
+
widget->resize(1, 1);
// We don't need this internal widget to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets)
QWidgetPrivate::allWidgets->remove(widget);
- initializing = false;
+ init = false;
}
return widget;
}
@@ -232,12 +233,17 @@ public:
cleanedUp = false;
}
+ bool initializing()
+ {
+ return init;
+ }
+
static bool cleanedUp;
static bool created;
private:
QGLWidget *widget;
- bool initializing;
+ bool init;
};
bool QGLGlobalShareWidget::cleanedUp = false;
@@ -268,6 +274,13 @@ void qt_destroy_gl_share_widget()
_qt_gl_share_widget()->destroy();
}
+bool qt_initializing_gl_share_widget()
+{
+ if (QGLGlobalShareWidget::created)
+ return _qt_gl_share_widget()->initializing();
+ return false;
+}
+
const QGLContext *qt_gl_share_context()
{
QGLWidget *widget = qt_gl_share_widget();
diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h
index 91d1f9e..6c8b71f 100644
--- a/src/opengl/qwindowsurface_gl_p.h
+++ b/src/opengl/qwindowsurface_gl_p.h
@@ -68,6 +68,7 @@ struct QGLWindowSurfacePrivate;
Q_OPENGL_EXPORT QGLWidget* qt_gl_share_widget();
Q_OPENGL_EXPORT void qt_destroy_gl_share_widget();
+bool qt_initializing_gl_share_widget();
class QGLWindowSurfaceGLPaintDevice : public QGLPaintDevice
{