Skip to content

Commit 7aebd25

Browse files
committed
fix inline lag
1 parent c940355 commit 7aebd25

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [0.56.3] - 2024-04-08
9+
10+
### Fixed
11+
12+
- Fixed inline mode not updating https://github.com/Textualize/textual/issues/4403
13+
814
## [0.56.2] - 2024-04-07
915

1016
### Fixed
@@ -1859,6 +1865,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
18591865
- New handler system for messages that doesn't require inheritance
18601866
- Improved traceback handling
18611867

1868+
[0.56.3]: https://github.com/Textualize/textual/compare/v0.56.2...v0.56.3
18621869
[0.56.2]: https://github.com/Textualize/textual/compare/v0.56.1...v0.56.2
18631870
[0.56.1]: https://github.com/Textualize/textual/compare/v0.56.0...v0.56.1
18641871
[0.56.0]: https://github.com/Textualize/textual/compare/v0.55.1...v0.56.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "0.56.2"
3+
version = "0.56.3"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/screen.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)