#Unable to create window with custom attributes

2 messages · Page 1 of 1 (latest)

wispy fog
#

I have a tuari command new_instance and it does create a window with the name tao window but it is labeled tao window and it has decorations, it is resizable and isn't auto resized to 200 / 100, and is just a white screen. Also when I open it it doesn't let me close the windows one I just opened, and doesn't let me do anything with the previous windows. When I run the command it reads:

...
creating instance
b

and here is a snippet of my rust code.

...
#[tauri::command]
fn new_instance(app: tauri::AppHandle) {
  println!("creating instance");
  if app.get_window("new-instance").is_some() {
    app.get_window("new-instance").unwrap().show().unwrap();
  } else {
    println!("b");
    let new_instance = tauri::WindowBuilder::new(
      &app,
      "new-instance",
      tauri::WindowUrl::App("new-instance".into()),
    ).build().unwrap();
    new_instance.set_title("New Instance").unwrap();
    new_instance.set_decorations(false).unwrap();
    new_instance.set_resizable(false).unwrap();
    new_instance.set_size(Size::Logical(LogicalSize { width: 200.0, height: 100.0 })).unwrap();
    new_instance.show().unwrap();
  }
}
...
ivory ice