summaryrefslogtreecommitdiffstats
path: root/src/plugins/graphicssystems
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-02-01 16:59:54 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-02-02 09:48:42 (GMT)
commit5ad8cd48a1ed3be183c0af8698491b039f0054e4 (patch)
tree11c2c2ea1ab07e09895a4fc79d6fca92a7736e5b /src/plugins/graphicssystems
parent186a9f967394d554ce99b8a3313cbc679b54c7c7 (diff)
downloadQt-5ad8cd48a1ed3be183c0af8698491b039f0054e4.zip
Qt-5ad8cd48a1ed3be183c0af8698491b039f0054e4.tar.gz
Qt-5ad8cd48a1ed3be183c0af8698491b039f0054e4.tar.bz2
Prevent recursion when creating window surface.
If we can't access the qt_gl_share_widget() we should just create a raster window surface. This might happen when creating the share widget itself leads to creation of a window surface (which isn't really going to be used anyways). Reviewed-by: Michael Dominic K
Diffstat (limited to 'src/plugins/graphicssystems')
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index 20b092e..a70d232 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -42,6 +42,7 @@
#include <QDebug>
#include <private/qpixmap_raster_p.h>
#include <private/qwindowsurface_gl_p.h>
+#include <private/qwindowsurface_raster_p.h>
#include <private/qegl_p.h>
#include <private/qglextensions_p.h>
#include <private/qgl_p.h>
@@ -75,7 +76,12 @@ QMeeGoGraphicsSystem::~QMeeGoGraphicsSystem()
QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const
{
- QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ QGLWidget *shareWidget = qt_gl_share_widget();
+
+ if (!shareWidget)
+ return new QRasterWindowSurface(widget);
+
+ QGLShareContextScope ctx(shareWidget->context());
QMeeGoGraphicsSystem::surfaceWasCreated = true;
QWindowSurface *surface = new QGLWindowSurface(widget);