From a4121a2c2e13c274e27fc653df907ceaeca8132f Mon Sep 17 00:00:00 2001 From: Boqin Qin Date: Thu, 28 May 2020 00:24:08 +0800 Subject: [PATCH] platform_impl/linux/x11: fix deadlock in fn set_fullscreen_inner (#1579) Co-authored-by: Kirill Chibisov --- CHANGELOG.md | 1 + src/platform_impl/linux/x11/window.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 279905d6..cc920994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Unreleased +- On X11, fix deadlock when calling `set_fullscreen_inner`. - On Web, prevent the webpage from scrolling when the user is focused on a winit canvas - On Wayland, fix deadlock when calling to `set_inner_size` from a callback. diff --git a/src/platform_impl/linux/x11/window.rs b/src/platform_impl/linux/x11/window.rs index f178ba3a..f4cb3d45 100644 --- a/src/platform_impl/linux/x11/window.rs +++ b/src/platform_impl/linux/x11/window.rs @@ -640,6 +640,7 @@ impl UnownedWindow { let flusher = self.set_fullscreen_hint(false); let mut shared_state_lock = self.shared_state.lock(); if let Some(position) = shared_state_lock.restore_position.take() { + drop(shared_state_lock); self.set_position_inner(position.0, position.1).queue(); } Some(flusher)