Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

force intial resize event #5296

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- Fixed infinite loop in `Widget.anchor` https://github.com/Textualize/textual/pull/5290
- Fixed delayed App Resize event https://github.com/Textualize/textual/pull/5296

## [0.87.1] - 2024-11-24

Expand Down
3 changes: 3 additions & 0 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3067,6 +3067,9 @@ async def invoke_ready_callback() -> None:
try:
try:
await self._dispatch_message(events.Compose())
await self._dispatch_message(
events.Resize.from_dimensions(self.size, None)
)
default_screen = self.screen
self.stylesheet.apply(self)
await self._dispatch_message(events.Mount())
Expand Down
5 changes: 2 additions & 3 deletions src/textual/drivers/linux_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ def _stop_again(*_) -> None:
loop = asyncio.get_running_loop()

def send_size_event() -> None:
if self._in_band_window_resize:
return
terminal_size = self._get_terminal_size()
width, height = terminal_size
textual_size = Size(width, height)
Expand All @@ -231,7 +229,8 @@ def send_size_event() -> None:
self._writer_thread.start()

def on_terminal_resize(signum, stack) -> None:
send_size_event()
if not self._in_band_window_resize:
send_size_event()

signal.signal(signal.SIGWINCH, on_terminal_resize)

Expand Down
Loading
Loading