Skip to content

Commit

Permalink
Merge pull request #4558 from Textualize/fix-freeze
Browse files Browse the repository at this point in the history
fix freeze
  • Loading branch information
willmcgugan authored May 26, 2024
2 parents 5195a57 + b907178 commit c0e6743
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
## [0.63.4]

### Added

- Added `immediate` switch to `Signal.publish`

### Fixed

- Fixed freeze in recompose from bindings https://github.com/Textualize/textual/pull/4558

## [0.63.3] - 2024-05-24

### Fixed
Expand Down Expand Up @@ -2019,6 +2023,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
- New handler system for messages that doesn't require inheritance
- Improved traceback handling

[0.63.4]: https://github.com/Textualize/textual/compare/v0.63.3...v0.63.4
[0.63.3]: https://github.com/Textualize/textual/compare/v0.63.2...v0.63.3
[0.63.2]: https://github.com/Textualize/textual/compare/v0.63.1...v0.63.2
[0.63.1]: https://github.com/Textualize/textual/compare/v0.63.0...v0.63.1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.63.3"
version = "0.63.4"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
11 changes: 6 additions & 5 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,11 +1123,12 @@ async def recompose(self) -> None:
Recomposing will remove children and call `self.compose` again to remount.
"""
if self._parent is not None:
async with self.batch():
await self.query("*").exclude(".-textual-system").remove()
if self.is_attached:
await self.mount_all(compose(self))
if not self.is_attached:
return
async with self.batch():
await self.query("*").exclude(".-textual-system").remove()
if self.is_attached:
await self.mount_all(compose(self))

def _post_register(self, app: App) -> None:
"""Called when the instance is registered.
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def compose(self) -> ComposeResult:

def on_mount(self) -> None:
async def bindings_changed(screen: Screen) -> None:
if screen is self.screen:
if self.is_attached and screen is self.screen:
await self.recompose()

self.screen.bindings_updated_signal.subscribe(self, bindings_changed)
Expand Down

0 comments on commit c0e6743

Please sign in to comment.