Fix: deadlock when requesting redraw on X11 (#1408)

This commit is contained in:
Diggory Hardy 2020-01-18 17:49:02 +00:00 committed by Freya Gentz
parent 1fe4a7a4ea
commit d934f94704

View file

@ -395,7 +395,6 @@ impl<T: 'static> EventLoop<T> {
let mut xev = MaybeUninit::uninit(); let mut xev = MaybeUninit::uninit();
let wt = get_xtarget(&self.target); 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()) } { while unsafe { self.event_processor.poll_one_event(xev.as_mut_ptr()) } {
let mut xev = unsafe { xev.assume_init() }; let mut xev = unsafe { xev.assume_init() };
@ -409,7 +408,7 @@ impl<T: 'static> EventLoop<T> {
super::WindowId::X(wid), super::WindowId::X(wid),
)) = event )) = event
{ {
pending_redraws.insert(wid); wt.pending_redraws.lock().unwrap().insert(wid);
} else { } else {
callback(event, window_target, control_flow); callback(event, window_target, control_flow);
} }