Closed kbembedded closed 1 year ago
There is an incorrect usage of the View:
Thank you for pointing that out. I apologize for taking more of your time, but I have a followup question:
Does that mean that what I described as the functional behavioral differences above, i.e. when manually starting the example applications the draw callback being called every tick, is that considered incorrect behavior from the firmware? It was pointed out to me that the behavioral differences are correlated to whether or not the Flipper runs the loading hourglass animation on application startup.
I am not sure if the described differences are unexpected behavior or if they fall under your statement of [ViewPort draw callback] may be called at anytime or not called at all if there is no redraw requests.
and are simply an effect of how the application is loaded and whether or not it is intentional it is still acceptable behavior.
Nope, firmware behavior is correct.
Draw calls only happens when they are requested. There is no such thing like draw call schedule.
Any active ViewPort can request draw call. Some requests from another ViewPorts may be delivered to your application.
When you starting app from RPC or CLI there are no other windows visible and that's why you don't see parasitic draw calls.
The only right way for your application to behave is to accept any draw calls at any time. And if explicit redraw needed then call view_port_update or view_commit_model.
Describe the bug.
I've done a bisect and tracked it down to 761a14e6e2ffd417a8afe2eb8dd6f24dd812f9b5
Essentially, for a couple of applications (examples below) when the application is started via
ftb launch...
orufbt launch...
when the flipper is on the idle/animation screen, some combination of events causes View draw callbacks registered in a view registered with a View Dispatcher to not get called. This does not appear to happen if the Flipper is not on the idle/animation screen.What ends up happening is when a view is switched to, the draw callback is called once, and never again. Under normal circumstances it looks like
view_port_draw
andview_dispatcher_draw_callback
are called every tick. However, when in the problem state neither of those get called either. An application not using view dispatcher and manually switching views does not appear to be affected by this.I'd love to dig deeper in to it, but the affected commit was the huge change to application loading and is a rollup of many things. I don't know the FW that well yet and figured it would be better to open an issue and let someone else deal with it.
Reproduction
Examples of this occurring:
applications_user/
clone https://github.com/kbembedded/Flipper-Zero-Game-Boy-Pokemon-Trading/tree/code-refactor aspokemon
fbt launch...
with the flipper on the idle/animation screen.ufbt launch...
as well(u)fbt launch...
used to start it.Another example is from https://github.com/jamisonderek/flipper-zero-tutorials/blob/main/ui/basic_scenes however, you will need a debugger attached and running
applications_user/
asbasic_scenes
and build/launch with./fbt launch...
with the Flipper on the idle/animation screen.Lotto Numbers
viewview_port_draw
andview_dispatcher_draw
and note that they never run on ticks while on this screen.If you repeat the above on a commit before 761a14e6e2ffd417a8afe2eb8dd6f24dd812f9b5 of the Flipper firmware, the applications run as expected.
Target
No response
Logs
Anything else?
No response