Repository navigation
fix(lvgl): a new app starts on a fresh screen (release 0.10.1) - #58
Merged
Merged
Conversation
App reset emptied the active screen (lv_obj_clean) but kept the screen
object, so anything an app set on the screen itself outlived it —
`lvgl.bind(name).screen():set{ bg_color = ... }`, the one-property tweak
luavgl documents, lands as a local style, and a local style outranks every
later app's theme. On a clock, one app whitened its screen and every app
after it showed a white ring around whatever it drew, until a reboot. The
display's theme leaked the same way: one Lua state lives as long as the
device, and luavgl keeps a set_theme installed in it until replaced.
LvglModule::onAppReset now uninstalls the theme Lua set on each display
(luavgl's own set_theme(nil), so its per-display record agrees) and
replaces the active screen with a new one, which LVGL deletes along with
everything on it. Stale Lua handles are safe as before: luavgl invalidates
them on C-side deletion, and its bound constructors resolve the active
screen at call time.
Checked in hawthorn-firmware's clock sim (the same patch over 0.9.1): an
app that whitens the screen, then a smiley, now shows the smiley's dark
ground; six rounds of that swap end clean; the agent-status overlay still
repaints; and a plain app is byte-identical whether or not an app that
installed a red theme ran first. The bug itself reproduced on the clock's
hardware. Unit tests, static analysis and the m5stick-lvgl example pass.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
App reset emptied the active LVGL screen but kept the screen object, so a style an app set on the screen itself (
lvgl.bind(name).screen():set{ bg_color = ... }) outlived it and outranked every later app's theme. On a clock, an app that whitened its screen left every later app with a white ring around whatever it drew, until a reboot. The display's Lua-set theme leaked the same way.LvglModule::onAppResetnow:set_theme(nil)so its bookkeeping agrees;Releases 0.10.1 (
library.json,idf_component.yml, changelog).Tested
m5stick-lvglpass.🤖 Generated with Claude Code