From b54aaf65ca5063e99d7a14913b29ab8c6d46abcf Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 4 Dec 2021 11:58:00 -0400 Subject: [PATCH] Fix the default error handler drawing when love.graphics is inactive. love.graphics.isActive() is false on mobile devices when the app isn't in the foreground. On iOS there can be a few frames between when the app is backgrounded and when the OS pauses it, where it's not valid to call OpenGL functions or present the screen. --- src/modules/love/callbacks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/love/callbacks.lua b/src/modules/love/callbacks.lua index 38ee277ac..320b380e7 100644 --- a/src/modules/love/callbacks.lua +++ b/src/modules/love/callbacks.lua @@ -259,6 +259,7 @@ function love.errhand(msg) p = p:gsub("%[string \"(.-)\"%]", "%1") local function draw() + if not love.graphics.isActive() then return end local pos = 70 love.graphics.clear(89/255, 157/255, 220/255) love.graphics.printf(p, pos, pos, love.graphics.getWidth() - pos) @@ -270,7 +271,6 @@ function love.errhand(msg) if not love.system then return end love.system.setClipboardText(fullErrorText) p = p .. "\nCopied to clipboard!" - draw() end if love.system then