MCPcopy
hub / github.com/Textualize/textual / _compositor_refresh

Method _compositor_refresh

src/textual/screen.py:1188–1234  ·  view source on GitHub ↗

Perform a compositor refresh.

(self)

Source from the content-addressed store, hash-verified

1186 await self._invoke_and_clear_callbacks()
1187
1188 def _compositor_refresh(self) -> None:
1189 """Perform a compositor refresh."""
1190
1191 app = self.app
1192
1193 if app.is_inline:
1194 if self is app.screen:
1195 inline_height = app._get_inline_height()
1196 clear = (
1197 app._previous_inline_height is not None
1198 and inline_height < app._previous_inline_height
1199 )
1200 app._display(
1201 self,
1202 self._compositor.render_inline(
1203 app.size.with_height(inline_height),
1204 screen_stack=app._background_screens,
1205 clear=clear,
1206 ),
1207 )
1208 app._previous_inline_height = inline_height
1209 self._dirty_widgets.clear()
1210 self._compositor._dirty_regions.clear()
1211 elif (
1212 self in self.app._background_screens and self._compositor._dirty_regions
1213 ):
1214 app.screen.refresh(*self._compositor._dirty_regions)
1215 self._compositor._dirty_regions.clear()
1216 self._dirty_widgets.clear()
1217
1218 else:
1219 if self is app.screen:
1220 # Top screen
1221 update = self._compositor.render_update(
1222 screen_stack=app._background_screens
1223 )
1224 app._display(self, update)
1225 self._dirty_widgets.clear()
1226 elif (
1227 self in self.app._background_screens and self._compositor._dirty_regions
1228 ):
1229 self._set_dirty(*self._compositor._dirty_regions)
1230 app.screen.refresh(*self._compositor._dirty_regions)
1231 self._repaint_required = True
1232 self._compositor._dirty_regions.clear()
1233 self._dirty_widgets.clear()
1234 app._update_mouse_over(self)
1235
1236 def _on_timer_update(self) -> None:
1237 """Called by the _update_timer."""

Callers 2

_on_timer_updateMethod · 0.95
_refresh_layoutMethod · 0.95

Calls 9

_displayMethod · 0.80
render_inlineMethod · 0.80
with_heightMethod · 0.80
render_updateMethod · 0.80
_set_dirtyMethod · 0.80
_update_mouse_overMethod · 0.80
_get_inline_heightMethod · 0.45
clearMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected