Skip to content

Commit

Permalink
reduce jank
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Oct 27, 2024
1 parent 26eb2c3 commit 0c550c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/textual/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,11 +1205,13 @@ def _get_inline_height(self, size: Size) -> int:

def _screen_resized(self, size: Size):
"""Called by App when the screen is resized."""
self._compositor_refresh()
self._refresh_layout(size)
if self.stack_updates:
self._compositor_refresh()
self._refresh_layout(size)

def _on_screen_resume(self) -> None:
"""Screen has resumed."""

if self.app.SUSPENDED_SCREEN_CLASS:
self.remove_class(self.app.SUSPENDED_SCREEN_CLASS)
self.stack_updates += 1
Expand Down
1 change: 1 addition & 0 deletions src/textual/widgets/_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ async def bindings_changed(self, screen: Screen) -> None:
await self.recompose()

def on_mount(self) -> None:
self.call_next(self.bindings_changed, self.screen)
self.screen.bindings_updated_signal.subscribe(self, self.bindings_changed)

def on_unmount(self) -> None:
Expand Down

0 comments on commit 0c550c6

Please sign in to comment.