From c1eb7f96291c248f69dc605342bda229ad2007c3 Mon Sep 17 00:00:00 2001 From: David Craven Date: Wed, 5 Feb 2020 00:46:19 +0100 Subject: [PATCH] Fix deadlock wayland. (#1438) --- src/platform_impl/linux/wayland/window.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform_impl/linux/wayland/window.rs b/src/platform_impl/linux/wayland/window.rs index f241f503..03b58b38 100644 --- a/src/platform_impl/linux/wayland/window.rs +++ b/src/platform_impl/linux/wayland/window.rs @@ -481,9 +481,10 @@ impl WindowStore { for window in &mut self.windows { let opt_arc = window.frame.upgrade(); let mut opt_mutex_lock = opt_arc.as_ref().map(|m| m.lock().unwrap()); + let mut size = { *window.size.lock().unwrap() }; f(WindowStoreForEach { newsize: window.newsize.take(), - size: &mut *(window.size.lock().unwrap()), + size: &mut size, prev_dpi: window.current_dpi, new_dpi: window.new_dpi, closed: window.closed, @@ -492,6 +493,7 @@ impl WindowStore { wid: make_wid(&window.surface), frame: opt_mutex_lock.as_mut().map(|m| &mut **m), }); + *window.size.lock().unwrap() = size; if let Some(dpi) = window.new_dpi.take() { window.current_dpi = dpi; }