TouchGFX does not invalidate the image whose visibility state has changed
Hello,
My TouchGFX application (without an operating system) receives events from a communication channel, and in some cases, there are icons on the screen that need to change visibility based on the received state. The events are acquired during the normal polling cycle of the application. When, for example, an alarm arrives, the icon with the exclamation mark is displayed in this way:
void sHomeView::updateErrorView(bool error)
{
imgCommErr.setVisible(error);
imgCommErr.invalidate();
}
But invalidation does nothing; the screen portion is not redrawn.
The invalidation is not lost; it remains latent until another successful redraw event is triggered — for example, if a button is tapped, the imgCommErr object is also redrawn, as are any other objects that are in the same abnormal state.
To get it working as expected I need to call invalidation in this way:
static bool needToInvalidate = false;
static bool visibility = false;
void sHomeView::onTick()
{
if (needToInvalidate)
{
needToInvalidate = false;
imgCommErr.setVisible(visibility);
imgCommErr.invalidate();
}
}
void sHomeView::updateErrorView(bool error)
{
visibility = error;
needToInvalidate = true;
}
Why does invalidate only work when it is apparently synchronized with the screen refresh?
Best regards,
Stefano
