From e55f75fb560f956fa7ed310f678863bfb30f8d4d Mon Sep 17 00:00:00 2001 From: jrmoulton Date: Thu, 24 Oct 2024 02:19:22 -0600 Subject: [PATCH] Prioritize redraws over processing updates --- src/window_handle.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/window_handle.rs b/src/window_handle.rs index a83cdc519..35be358a8 100644 --- a/src/window_handle.rs +++ b/src/window_handle.rs @@ -81,6 +81,7 @@ pub(crate) struct WindowHandle { #[cfg(any(target_os = "linux", target_os = "freebsd"))] pub(crate) context_menu: RwSignal>, dropper_file: Option, + has_pending_redraw: bool, } impl WindowHandle { @@ -172,6 +173,7 @@ impl WindowHandle { context_menu, last_pointer_down: None, dropper_file: None, + has_pending_redraw: false, }; window_handle.app_state.set_root_size(size.get_untracked()); if let Some(theme) = theme.get_untracked() { @@ -632,6 +634,7 @@ impl WindowHandle { } pub fn paint(&mut self) -> Option { + self.has_pending_redraw = false; let mut cx = PaintCx { app_state: &mut self.app_state, paint_state: &mut self.paint_state, @@ -743,7 +746,8 @@ impl WindowHandle { } pub(crate) fn process_update(&mut self) { - if self.process_update_no_paint() { + if !self.has_pending_redraw && self.process_update_no_paint() { + self.has_pending_redraw = true; self.schedule_repaint(); } }