summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt/qwinrteglcontext.cpp
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-01-08 12:50:32 +0100
committerMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-01-11 10:06:36 +0000
commitbecbffe291c1105eb422e8dc66c67c5b6443b96c (patch)
tree0a1a7fc7839057ad5d4f824bb4f6a1b1be53b883 /src/plugins/platforms/winrt/qwinrteglcontext.cpp
parentc4ecab7127807eddd820b5c747a805cf5b0fd06d (diff)
winphone: Properly close the application
When shutting down an application on Windows Phone the SceneGraph tries to create an offscreen surface to render into. If there is no offscreen surface available, it creates a new native window and tries to hide it. As the native event loop is about to shut down, creation fails and exceptions are raised. Instead we create a vanilla QPlatformOffscreenSurface. The SceneGraph recognizes it as such and can handle a proper cleanup on its own. Furthermore removing the suspend/resume handler in the destructor of QWinRTIntegration fails for Windows Phone as the application object itself does not accept this anymore. Hence skip this part for this platform. Task-number: QTBUG-49310 Change-Id: I02acdd5a635ef0b9d6ef8199376537b8f0f1a8fb Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrteglcontext.cpp')
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
index ebd15d7184..bc77df566e 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
@@ -46,6 +46,7 @@
#define EGL_EGLEXT_PROTOTYPES
#include <EGL/eglext.h>
+#include <QOffscreenSurface>
#include <QOpenGLContext>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
@@ -147,6 +148,9 @@ bool QWinRTEGLContext::makeCurrent(QPlatformSurface *windowSurface)
Q_D(QWinRTEGLContext);
Q_ASSERT(windowSurface->surface()->supportsOpenGL());
+ if (windowSurface->surface()->surfaceClass() == QSurface::Offscreen)
+ return false;
+
QWinRTWindow *window = static_cast<QWinRTWindow *>(windowSurface);
if (window->eglSurface() == EGL_NO_SURFACE)
window->createEglSurface(g->eglDisplay, d->eglConfig);