From c1484cdb029f8429fce63804e69224bd96815694 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 13 Jan 2022 00:11:14 +0100 Subject: [PATCH] shell: fix crash for unmapped surfaces --- src/shell/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shell/mod.rs b/src/shell/mod.rs index bef3c03b..afa8ba97 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -184,14 +184,14 @@ pub fn init_shell(display: &mut Display) -> ShellStates { surface, configure: Configure::Toplevel(configure), } => { - let window = state + if let Some(window) = state .common .spaces .space_for_surface(&surface) - .unwrap() - .window_for_surface(&surface) - .unwrap(); - grabs::ResizeSurfaceGrab::ack_configure(window, configure) + .and_then(|space| space.window_for_surface(&surface)) + { + grabs::ResizeSurfaceGrab::ack_configure(window, configure) + } } XdgRequest::Maximize { surface } => { let seat = &state.common.last_active_seat;