I'm new to Tauri (and Rust) and trying to set my app window's isDocumentEdited
status (a macOS-only feature). I found a feature request that seems to indicate that Tauri supports this, which includes a brief example:
Event::MainEventsCleared => {
// Change window document_edited status every other second
let clock: bool = (start_time.elapsed().as_secs) % 2) = 0;
window.set_is_document_edited(clock);
assert_eq!(window.is_document_edited(), clock);
}
However, when I invoke set_is_document_edited
method on a window in Tauri, the compiler throws an error. Additionally, I can't find any reference to it in the Tauri source.
It looks like this is a feature of the upstream crate TAO, not Tauri itself — but I don't understand how the above example is working.
When I try to use the equivalent method:
let window = app.get_window("main").unwrap(); // works
window.set_is_document_edited(true); // doesn't work
The compiler throws an error:
error[E0599]: no method named `set_is_document_edited` found for struct `Window` in the current scope
window.set_is_document_edited(true);
^^^^^^^^^^^^^^^^^^^^^^ method not found in `Window`
What am I missing or doing wrong?