Skip to main content

spawn_render_watchdog

Function spawn_render_watchdog 

Source
fn spawn_render_watchdog<R: Runtime>(
    app: &AppHandle<R>,
    current_break: &Arc<Mutex<Option<BreakEvent>>>,
    epoch: u64,
)
Expand description

Spawn the grace-period task that aborts a never-rendered break. Captures cloned Arcs + AppHandle so it outlives fire_break’s borrows.

The teardown is marshalled onto the main thread: abort_stranded_break iterates and hides webview windows, and on X11/GTK those calls must not run off the GUI thread (a worker-thread window op trips xcb_xlib_threads_sequence_lost). run_on_main_thread serialises it onto the event loop, mirroring the tray’s status-title update.