Fix exit_on_last_window_close for UserWindowEvent::CloseWindow (#5047)

* Fix exit_on_last_window_close for UserWindowEvent::CloseWindow

* fix: unify under close_requested

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
KlemenandJonathan Kelley authored and GitHub committed 2025-12-04 17:26:32 -08:00
1 parent 3fef7a9962
commit 3b9558d8eb
2 files changed
+1 -11

No files matched your search

-10
View File
@@ -302,16 +302,6 @@ impl App {
_ = self.shared.proxy.send_event(UserWindowEvent::Poll(id));
}
/// Todo: maybe we should poll the virtualdom asking if it has any final actions to apply before closing the webview
///
/// Technically you can handle this with the use_window_event hook
pub fn handle_close_msg(&mut self, id: WindowId) {
self.webviews.remove(&id);
if self.webviews.is_empty() {
self.control_flow = ControlFlow::Exit
}
}
pub fn handle_query_msg(&mut self, msg: IpcMessage, id: WindowId) {
let Ok(result) = serde_json::from_value::<QueryResult>(msg.params()) else {
return;