Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Resize faster #5343

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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 src/textual/message_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ async def _process_messages_loop(self) -> None:
break
if pending is None or not message.can_replace(pending):
break

try:
message = await self._get_message()
except MessagePumpClosed:
Expand Down
9 changes: 6 additions & 3 deletions src/textual/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ def _get_inline_height(self, size: Size) -> int:
def _screen_resized(self, size: Size):
"""Called by App when the screen is resized."""
if self.stack_updates:
self._compositor_refresh()
self._refresh_layout(size)

def _on_screen_resume(self) -> None:
Expand Down Expand Up @@ -1240,9 +1239,13 @@ def _on_screen_suspend(self) -> None:

async def _on_resize(self, event: events.Resize) -> None:
event.stop()
self._screen_resized(event.size)
size = self.app.size
if self.size == size:
return

self._screen_resized(size)
for screen in self.app._background_screens:
screen._screen_resized(event.size)
screen._screen_resized(size)

def _update_tooltip(self, widget: Widget) -> None:
"""Update the content of the tooltip."""
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading