You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With tauri, I can intercept CloseRequested, and display a confirmation dialog inside the same window while keeping it visible.
.on_window_event(|window, event| match event {
tauri::WindowEvent::CloseRequested{ api, .. } => {
api.prevent_close();// prevent non-confirmed closed (Ctrl+F4 or window's close button)
window.emit("CloseRequested",()).unwrap();// emit the event to webview, and from there, display a confirmation dialog}
_ => ()})
But when using dioxus, I'm forced to choose between hiding the window WindowCloseBehaviour::WindowHides or destroying the window WindowCloseBehaviour::WindowCloses.
// .with_exits_when_last_window_closes(false).with_close_behaviour(WindowCloseBehaviour::WindowHides).with_custom_event_handler(move |evt, event_loop_window_target| {ifletEvent::WindowEvent{event:WindowEvent::CloseRequested, .. } = evt {// panics outside of dioxus runtime, and I can't get a handle to window here
dioxus::desktop::window().set_visible(true);
My goals:
I hope that dioxus adds the support for keeping the window visible on CloseRequested.
As a temporary fix, I need to restore the visibility of the window
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
With tauri, I can intercept CloseRequested, and display a confirmation dialog inside the same window while keeping it visible.
But when using dioxus, I'm forced to choose between hiding the window
WindowCloseBehaviour::WindowHidesor destroying the windowWindowCloseBehaviour::WindowCloses.My goals:
Beta Was this translation helpful? Give feedback.
All reactions