From 0c11c0f95983a9e4bbf4ead054dbd502069a3418 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Fri, 7 Jun 2024 20:06:00 +0200 Subject: [PATCH] input: Fix deadlock holding shell during grab code --- src/input/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/input/mod.rs b/src/input/mod.rs index fd48373b..3136fcc2 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -213,6 +213,8 @@ impl State { let pointer = seat.get_pointer().unwrap(); let is_grabbed = keyboard.is_grabbed() || pointer.is_grabbed(); let current_focus = keyboard.current_focus(); + let shell_ref = self.common.shell.clone(); + let mut shell = shell_ref.write().unwrap(); if let Some((action, pattern)) = keyboard .input( self, @@ -222,7 +224,6 @@ impl State { time, |data, modifiers, handle| { // Leave move overview mode, if any modifier was released - let mut shell = data.common.shell.write().unwrap(); if let OverviewMode::Started(Trigger::KeyboardMove(action_modifiers), _) = shell.overview_mode().0 { @@ -466,6 +467,7 @@ impl State { } // keys are passed through to apps + std::mem::drop(shell); FilterResult::Forward }, )