From 4a00d632665423ddf943c2380a7bbe6c2b95f8e6 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 --- 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 279905d623e..2d15ae14990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Unreleased +- On X11, fix deadlock when calling `set_position_inner` from `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 f178ba3aa54..f4cb3d45363 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)