Browse Source

Pump events a couple times during bootup.

Fixes unexpectedly slow first frames on macOS.
Fixes #1859
Sasha Szpakowski 2 years ago
parent
commit
0f4304edd1
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/modules/love/boot.lua

+ 7 - 0
src/modules/love/boot.lua

@@ -304,6 +304,13 @@ function love.init()
 		end
 	end
 
+	-- The first couple event pumps on some systems (e.g. macOS) can take a
+	-- while. We'd rather hit that slowdown here than in event processing
+	-- within the first frames.
+	if love.event then
+		for i = 1, 2 do love.event.pump() end
+	end
+
 	-- Our first timestep, because window creation can take some time
 	if love.timer then
 		love.timer.step()