Makie how to know if a figure is displayed or not

Hello, I m doing a GUI in makie that calls some timer to refresh information displayed. I would like to close these timers either if the figure is not displayed or the closing cross button is clicked.
So is there a method to know the status displayed/ not displayed of a figure ? Or is there a way to link a function to the closing button of the figure window…Thanks