INNER CODE UNIT · Rust

wait_for_window_visible

owu/wsl-dashboard · src/app/tasks/mod.rs:156

pub async fn wait_for_window_visible(app_handle: &slint::Weak<crate::AppWindow>) {
    loop {
        let is_visible = {
            let ah = app_handle.clone();
            let (tx, rx) = tokio::sync::oneshot::channel();
            // Safely read window visibility on the Slint UI thread
            let _ = slint::invoke_from_event_loop(move || {
                let visible = if let Some(app) = ah.upgrade() {
                    app.get_is_window_visible()
                } else {
                    false
                };
                let _ = tx.send(visible);
            });
            rx.await.unwrap_or(false)
        };
        
        if is_visible {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…