xstate: ignore some more BadWindow errors

Closes #24
This commit is contained in:
Shawn Wallace 2024-05-28 22:31:04 -04:00
parent 02bee5aea7
commit 601223d3ae
3 changed files with 46 additions and 43 deletions

View file

@ -170,7 +170,10 @@ impl State {
#[track_caller]
fn get_toplevel(&mut self, surface_id: SurfaceId) -> &mut Toplevel {
let surface = self.surfaces.get_mut(&surface_id).unwrap();
let surface = self
.surfaces
.get_mut(&surface_id)
.expect("Surface does not exist");
match &mut surface.role {
Some(SurfaceRole::Toplevel(t)) => t,
other => panic!("Surface does not have toplevel role: {:?}", other),