From d934f947046cd46bd282a8dc630df82dba7cc220 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Sat, 18 Jan 2020 17:49:02 +0000 Subject: [PATCH] Fix: deadlock when requesting redraw on X11 (#1408) --- src/platform_impl/linux/x11/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index f0275bf9..7aea3b5e 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -395,7 +395,6 @@ impl EventLoop { let mut xev = MaybeUninit::uninit(); let wt = get_xtarget(&self.target); - let mut pending_redraws = wt.pending_redraws.lock().unwrap(); while unsafe { self.event_processor.poll_one_event(xev.as_mut_ptr()) } { let mut xev = unsafe { xev.assume_init() }; @@ -409,7 +408,7 @@ impl EventLoop { super::WindowId::X(wid), )) = event { - pending_redraws.insert(wid); + wt.pending_redraws.lock().unwrap().insert(wid); } else { callback(event, window_target, control_flow); }