Browse Source

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.
Alex Szpakowski 3 years ago
parent
commit
b54aaf65ca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/love/callbacks.lua

+ 1 - 1
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