Skip to content

Commit

Permalink
Post ScreenResume to default screen.
Browse files Browse the repository at this point in the history
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: #2581
  • Loading branch information
rodrigogiraoserrao committed May 17, 2023
1 parent 765c7ce commit 8399a31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8399a31

Please sign in to comment.