Defer the notice presenter's window until the first presentation#25637
Draft
crazytonyli wants to merge 3 commits into
Draft
Defer the notice presenter's window until the first presentation#25637crazytonyli wants to merge 3 commits into
crazytonyli wants to merge 3 commits into
Conversation
UntouchableWindow was created with init(frame:), which leaves it without a windowScene. Such a window does not display (or attaches to the wrong scene) under the UIScene life cycle. Add a windowScene initializer and use it in NoticePresenter when the main window's scene is available.
The presenter previously created its overlay window eagerly at setup. The window is now created lazily on the first foreground presentation and attached to the active scene, reattaching it if the scene has changed since the window was created. When no scene is connected yet (e.g. a notice posted during launch, before UIKit connects the scene), the notice stays at the head of the queue and presentation is retried once the app becomes active. The presenter also processes any notice posted before it was created, since the store does not replay state to new subscribers. The frame-based UntouchableWindow initializer is unused now and removed.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32518 | |
| Version | PR #25637 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 0bc2261 | |
| Installation URL | 112491658om9g |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32518 | |
| Version | PR #25637 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 0bc2261 | |
| Installation URL | 4fhgirq9btbig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Note
This PR will be merged after #25636