Retire inactive windows without invoking stopped runtimes
Verify Tessera GUI / verify (push) Failing after 7m31s
Verify Tessera GUI / verify (push) Failing after 7m31s
This commit is contained in:
@@ -1294,6 +1294,33 @@ impl UiBridge {
|
||||
state.current = id;
|
||||
Ok(())
|
||||
}
|
||||
pub fn retire_window(&self, vm: &mut Vm, id: u64) -> Result<()> {
|
||||
if id == crate::window::MAIN_WINDOW {
|
||||
bail!("the primary shell is closed by the OS window control");
|
||||
}
|
||||
let mut state = self
|
||||
.session
|
||||
.lock()
|
||||
.map_err(|_| anyhow::anyhow!("UI session poisoned"))?;
|
||||
let Some(view) = state.presentations.get_mut(&id) else {
|
||||
return Ok(());
|
||||
};
|
||||
let desktop = view.desktop;
|
||||
let window = object(Some(&vm.get_attr(desktop, "window")?))?;
|
||||
view.mounts.retire(vm, desktop)?;
|
||||
crate::window::retire(vm, window)?;
|
||||
vm.set_attr(desktop, "pending", Value::Nil)?;
|
||||
vm.set_attr(desktop, "focus", Value::Nil)?;
|
||||
vm.set_attr(desktop, "focusRequested", Value::Bool(false))?;
|
||||
// Draining is not publication: failed-domain effects are discarded.
|
||||
let _ = crate::window::take_commands(vm, window)?;
|
||||
let windows = object(Some(&vm.get_attr(state.master, "windows")?))?;
|
||||
vm.dict_delete(windows, &Value::Text(id.to_string()))?;
|
||||
state.presentations.remove(&id);
|
||||
state.current = crate::window::MAIN_WINDOW;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn finish_closed(&self, vm: &mut Vm) -> Result<()> {
|
||||
let mut state = self
|
||||
.session
|
||||
|
||||
Reference in New Issue
Block a user