From 40706089d4f6e47201cbb34754577590996a32c6 Mon Sep 17 00:00:00 2001 From: BurtonQin Date: Wed, 27 May 2020 23:21:51 +0800 Subject: [PATCH] platform_impl/linux/x11: fix deadlock in fn set_fullscreen_inner 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 279905d623..cc920994ce 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 f178ba3aa5..f4cb3d4536 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)