@@ -81,6 +81,7 @@ pub(crate) struct WindowHandle {
81
81
#[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
82
82
pub ( crate ) context_menu : RwSignal < Option < ( Menu , Point , bool ) > > ,
83
83
dropper_file : Option < PathBuf > ,
84
+ has_pending_redraw : bool ,
84
85
}
85
86
86
87
impl WindowHandle {
@@ -172,6 +173,7 @@ impl WindowHandle {
172
173
context_menu,
173
174
last_pointer_down : None ,
174
175
dropper_file : None ,
176
+ has_pending_redraw : false ,
175
177
} ;
176
178
window_handle. app_state . set_root_size ( size. get_untracked ( ) ) ;
177
179
if let Some ( theme) = theme. get_untracked ( ) {
@@ -632,6 +634,7 @@ impl WindowHandle {
632
634
}
633
635
634
636
pub fn paint ( & mut self ) -> Option < peniko:: Image > {
637
+ self . has_pending_redraw = false ;
635
638
let mut cx = PaintCx {
636
639
app_state : & mut self . app_state ,
637
640
paint_state : & mut self . paint_state ,
@@ -743,7 +746,8 @@ impl WindowHandle {
743
746
}
744
747
745
748
pub ( crate ) fn process_update ( & mut self ) {
746
- if self . process_update_no_paint ( ) {
749
+ if !self . has_pending_redraw && self . process_update_no_paint ( ) {
750
+ self . has_pending_redraw = true ;
747
751
self . schedule_repaint ( ) ;
748
752
}
749
753
}
0 commit comments