mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-09 14:25:12 +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
|
// Save window state on exit
|
||||||
match event {
|
match event {
|
||||||
RunEvent::ExitRequested{..} => {
|
RunEvent::WindowEvent {
|
||||||
let handle = app_handle.clone();
|
event: WindowEvent::CloseRequested { .. },
|
||||||
if let Err(e) = handle.save_window_state(StateFlags::all()) {
|
..
|
||||||
|
} => {
|
||||||
|
if let Err(e) = app_handle.save_window_state(StateFlags::all()) {
|
||||||
warn!("Failed to save window state {e:?}");
|
warn!("Failed to save window state {e:?}");
|
||||||
} else {
|
} else {
|
||||||
debug!("Saved window state");
|
debug!("Saved window state");
|
||||||
};
|
};
|
||||||
},
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user