fix: only render on changes

This commit is contained in:
2026-09-04 16:07:32 +02:00
parent 0419237433
commit 3cdbf90de1
2 changed files with 16 additions and 5 deletions
+11
View File
@@ -37,6 +37,10 @@ real_main :: proc() {
m3_init_dark()
// Only draw when something actually changed. Without this the loop renders
// flat out forever, which on a phone is straight battery burn.
engine.set_render_on_change(true)
for !engine.should_quit() {
engine.frame_start()
defer engine.frame_end()
@@ -55,6 +59,13 @@ real_main :: proc() {
if !insets_valid {
insets_valid = refresh_insets()
if !insets_valid {
// The decor view attaches asynchronously and produces no event
// when it does. Under render_on_change the loop would park
// before the retry ever ran, leaving the app bar with no status
// bar padding.
engine.request_render()
}
}
window_size := engine.get_window_size()