From 8399a31a461e102b951506493c444c2c28406b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Wed, 17 May 2023 10:09:52 +0100 Subject: [PATCH] Post ScreenResume to default screen. When the default screen is first created it was not getting the event ScreenResume. All other screens receive a ScreenResume when first created and _all_ screens (the default one and custom screens) receive this event when they become the active screen again, so this was kind of an edge case that needed the event to be posted by hand. Related comments: https://github.com/Textualize/textual/pull/2581\#issuecomment-1550231559 --- src/textual/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/textual/app.py b/src/textual/app.py index c1376cd22f..75703d8f75 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -2133,6 +2133,7 @@ async def on_event(self, event: events.Event) -> None: screen = Screen(id="_default") self._register(self, screen) self._screen_stack.append(screen) + screen.post_message(events.ScreenResume()) await super().on_event(event) elif isinstance(event, events.InputEvent) and not event.is_forwarded: