@@ -674,8 +674,8 @@ def _compositor_refresh(self) -> None:
674674
675675 app = self .app
676676
677- if self is app .screen :
678- if app .is_inline :
677+ if app .is_inline :
678+ if self is app .screen :
679679 inline_height = app ._get_inline_height ()
680680 clear = (
681681 app ._previous_inline_height is not None
@@ -692,18 +692,28 @@ def _compositor_refresh(self) -> None:
692692 app ._previous_inline_height = inline_height
693693 self ._dirty_widgets .clear ()
694694 self ._compositor ._dirty_regions .clear ()
695- else :
695+ elif (
696+ self in self .app ._background_screens and self ._compositor ._dirty_regions
697+ ):
698+ app .screen .refresh (* self ._compositor ._dirty_regions )
699+ self ._compositor ._dirty_regions .clear ()
700+ self ._dirty_widgets .clear ()
701+
702+ else :
703+ if self is app .screen :
696704 # Top screen
697705 update = self ._compositor .render_update (
698706 screen_stack = app ._background_screens
699707 )
700708 app ._display (self , update )
701709 self ._dirty_widgets .clear ()
702- elif self in self .app ._background_screens and self ._compositor ._dirty_regions :
703- # Background screen
704- app .screen .refresh (* self ._compositor ._dirty_regions )
705- self ._compositor ._dirty_regions .clear ()
706- self ._dirty_widgets .clear ()
710+ elif (
711+ self in self .app ._background_screens and self ._compositor ._dirty_regions
712+ ):
713+ # Background screen
714+ app .screen .refresh (* self ._compositor ._dirty_regions )
715+ self ._compositor ._dirty_regions .clear ()
716+ self ._dirty_widgets .clear ()
707717
708718 def _on_timer_update (self ) -> None :
709719 """Called by the _update_timer."""
@@ -848,10 +858,7 @@ def _refresh_layout(self, size: Size | None = None, scroll: bool = False) -> Non
848858 self .app ._handle_exception (error )
849859 return
850860 if self .is_current :
851- if self .app .is_inline :
852- self ._update_timer .resume ()
853- else :
854- self ._compositor_refresh ()
861+ self ._compositor_refresh ()
855862
856863 if self .app ._dom_ready :
857864 self .screen_layout_refresh_signal .publish ()
0 commit comments