Improved idle CPU utilisation when not-focused, added system.wait_event()

This commit is contained in:
rxi
2020-05-11 00:21:07 +01:00
parent b67b680975
commit c215eff6d8
2 changed files with 12 additions and 1 deletions
+4 -1
View File
@@ -347,7 +347,10 @@ function core.step()
-- update
core.root_view.size.x, core.root_view.size.y = width, height
core.root_view:update()
if not core.redraw then return end
if not core.redraw then
if not system.window_has_focus() then system.wait_event(0.5) end
return
end
core.redraw = false
-- close unreferenced docs