mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 18:28:37 +02:00
save window state on window close
This commit is contained in:
@@ -1954,14 +1954,16 @@ pub fn run() {
|
||||
|
||||
// Save window state on exit
|
||||
match event {
|
||||
RunEvent::ExitRequested{..} => {
|
||||
let handle = app_handle.clone();
|
||||
if let Err(e) = handle.save_window_state(StateFlags::all()) {
|
||||
RunEvent::WindowEvent {
|
||||
event: WindowEvent::CloseRequested { .. },
|
||||
..
|
||||
} => {
|
||||
if let Err(e) = app_handle.save_window_state(StateFlags::all()) {
|
||||
warn!("Failed to save window state {e:?}");
|
||||
} else {
|
||||
debug!("Saved window state");
|
||||
};
|
||||
},
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user