Use new events API for inline backend flush_figures