path: root/src/plugins/platforms/ios/
diff options
authorTor Arne Vestbø <>2016-06-16 16:28:20 +0200
committerTor Arne Vestbø <>2016-06-17 13:18:33 +0000
commitd2bffe0fc9461f7cbbaf639bfc76050f4de8a46f (patch)
tree9213481d9a3a31cc49a2b25b3a5cfc33e9603bac /src/plugins/platforms/ios/
parent3e4f885f0c8f9d4e951241459d310ed977936806 (diff)
UIKit: Detect swapBuffers on non-exposed windows and skip flush
When using threaded rendering the render-thread might be half-way into rendering a frame when the application is backgrounded, resulting in the following swap happening on a non-exposed window. This may result in the system killing the application, as rendering is not supposed to happen when an application is backgrounded, so we skip the flush. Change-Id: I9ab8f2c4617391fd827558af9fb473f1734b3688 Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'src/plugins/platforms/ios/')
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index e76a2b9902..eeb07b2796 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -211,6 +211,11 @@ void QIOSContext::swapBuffers(QPlatformSurface *surface)
if (surface->surface()->surfaceClass() == QSurface::Offscreen)
return; // Nothing to do
+ if (!static_cast<QIOSWindow *>(surface)->isExposed()) {
+ qCWarning(lcQpaGLContext, "Detected swapBuffers on a non-exposed window, skipping flush");
+ return;
+ }
FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface);
Q_ASSERT_X(framebufferObject.isComplete, "QIOSContext", "swapBuffers on incomplete FBO");