Keep Open and Save asynchronous to prevent macOS resize crashes (#1127)
Open and Save use parented AsyncFileDialog sheets; their answers run on the UI thread in a later frame, so resizing the window while a picker is open no longer re-enters winit and aborts. Editors, tab changes, Close/Quit and model-changing control requests wait for the answer; the local library Open and Export in the Appearance dialog use the same flow. Fixes #1088.
This commit is contained in:
1 parent
f425089983
commit
37547f8eba
18 files changed
+564
-137
No files matched your search
@@ -165,10 +165,15 @@ pub fn start_hook(app: &mut SolveApp, id: &str) -> bool {
|
||||
if !matches!(id, "canvas.insert" | "canvas.decal") {
|
||||
return true;
|
||||
}
|
||||
let path = app.services.pick_open.as_ref().and_then(|f| f());
|
||||
let ok = path.is_some();
|
||||
IMAGE.with(|i| *i.borrow_mut() = path);
|
||||
ok
|
||||
let command = id.to_string();
|
||||
app.pick_open(move |app, path| {
|
||||
if let Some(path) = path {
|
||||
IMAGE.with(|i| *i.borrow_mut() = Some(path));
|
||||
app.last_command = solidcraft_engine::find_command(&command).map(|spec| (spec.id.into(), spec.label.into()));
|
||||
app.tool = crate::tools::Tool::for_command(&command);
|
||||
}
|
||||
});
|
||||
false
|
||||
}
|
||||
|
||||
fn v3(v: &Value) -> Option<Vec3> {
|
||||
|
||||
Reference in new issue
Block a user