diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index ffb9fc6e..d06936c5 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -24,7 +24,7 @@ pub use self::{ use std::{ cell::RefCell, - collections::HashMap, + collections::{HashMap, HashSet}, ffi::CStr, mem::{self, MaybeUninit}, ops::Deref, @@ -309,7 +309,13 @@ impl EventLoop { } // Empty the redraw requests { + let mut windows = HashSet::new(); + while let Ok(window_id) = self.redraw_channel.try_recv() { + windows.insert(window_id); + } + + for window_id in windows { let window_id = crate::window::WindowId(super::WindowId::X(window_id)); sticky_exit_callback( Event::RedrawRequested(window_id),