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

This commit is contained in:
rxi committed 2020-05-11 00:21:07 +01:00
1 parent b67b680975
commit c215eff6d8
2 files changed
+12 -1

No files matched your search

+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