MWT multiple desktops: Animation not working


I am working on a GUI app using MWT library.
In this application, the user can switch between multiple Desktops.
After switching back and forth, my animations are broken.

Any idea what could cause this ?

Thank you,

Hello Alan,

Only a single Displayable can be shown on the display at any time. When a new Displayable is going to be shown on the display, the Displayable which is already shown (if any) is automatically hidden.

Since only a single Animator may be running at any time, you should make sure that you are not starting any Animation on the Animator of a Desktop which is not currently shown.

The recommended practice is to start animations in the onShown() method of the widget and to stop them in its onHidden() method. Note that when a Desktop is going to be hidden, all the Animations started by its Animator instance are automatically stopped. This is to make sure that in case an Animation was not correctly stopped by its widget, the Animator of the newly shown Desktop can run correctly.

You can refer to this documentation for more information.

Best regards,

Hello Andy,

Thank you for the detailed explanation !
I indeed had a timer task starting animations in the background.
Cancelling this task in the onHidden() method solves my issue.

Thank you !