From becbffe291c1105eb422e8dc66c67c5b6443b96c Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Fri, 8 Jan 2016 12:50:32 +0100 Subject: 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 --- src/plugins/platforms/winrt/qwinrteglcontext.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/platforms/winrt/qwinrteglcontext.cpp') 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 +#include #include #include @@ -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(windowSurface); if (window->eglSurface() == EGL_NO_SURFACE) window->createEglSurface(g->eglDisplay, d->eglConfig); -- cgit v1.2.3