#Tauri Process Hangs When Exiting "Main" window, with child window open

9 messages · Page 1 of 1 (latest)

cloud stump
#

Here is the command opening a new Webview Window, and parenting it to the "main" window

#[tauri::command]
pub async fn show_branch_operation_window(app: tauri::AppHandle) -> Result<(), ApplicationError> {
    let main_window = app
        .get_webview_window("main")
        .ok_or(ApplicationError::Warning(
            "Window not found: 'main'".to_string(),
        ))?;

    tauri::WebviewWindowBuilder::new(
        &app,
        "branch-operations",
        tauri::WebviewUrl::App("index.html".into()),
    )
    .parent(&main_window)?
    .center()
    .build()?;

    Ok(())
}

A video is attached showing how the process hangs

lament hawk
#

This discord server is not a good place to report bugs. Please ope n an issue on github instead.

As a workaround, does it work if you listen to the closerequested event on the main window and destroy the child in the event handler?

cloud stump
#

I'll look into that work around, and post a GitHub issue

cloud stump
#

Because it doesn't seem to work

lament hawk
lament hawk
cloud stump
#

Sorry, i've been super busy. This work around works 🙂

fn on_window_event(window: &Window, event: &WindowEvent) {
    match event {
        WindowEvent::CloseRequested { .. } => {
            if window.label() != "main" {
                return;
            }
            if let Some(w) = window.get_webview_window("branch-operations") {
                w.destroy().unwrap();
            }
        }
        _ => (),
    }
}

I will be creating that Github Issue after I get back from my doctors appointment today.

(Already posted this message on my old account I somehow got logged back into on my phone)