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

macOS/iOS: Various refactorings in application state #3720

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Jun 6, 2024

I'm preparing to get rid of our application delegate in favour of registering notification observers, to do so I'm renaming app_delegate.rs to app_state.rs, and moving the functionality out of the Objective-C method into a normal method.

Additionally, AppState previously implemented Default, but really, this was a hack done because someone (probably myself) was too lazy to write out the full initialization in AppDelegate::new.

This is (deliberately) a non-functional change.

  • Tested on all platforms changed

EDIT: Builds up to #3758.

@madsmtm madsmtm requested a review from kchibisov June 6, 2024 12:08
Comment on lines +670 to +671
for window in application.windows().iter() {
if window.is_kind_of::<WinitUIWindow>() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to filter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not at this time, it's a safety condition for the unsafe just below, and moving it to filter makes it seem like they're less connected.

src/platform_impl/ios/app_state.rs Show resolved Hide resolved
@madsmtm madsmtm merged commit 3a624e0 into master Jun 6, 2024
52 checks passed
@madsmtm madsmtm deleted the madsmtm/refactor-in-app-state branch June 6, 2024 12:39
kchibisov pushed a commit that referenced this pull request Jun 10, 2024
I'm preparing to get rid of our application delegate in favour of registering
notification observers, to do so I'm renaming `app_delegate.rs` to
`app_state.rs`, and moving the functionality out of the Objective-C method
into a normal method.

Additionally, `AppState` previously implemented `Default`, but really, this
was a hack done because someone (probably myself) was too lazy to write out
the full initialization in `AppDelegate::new`.
kchibisov pushed a commit that referenced this pull request Jun 10, 2024
I'm preparing to get rid of our application delegate in favour of registering
notification observers, to do so I'm renaming `app_delegate.rs` to
`app_state.rs`, and moving the functionality out of the Objective-C method
into a normal method.

Additionally, `AppState` previously implemented `Default`, but really, this
was a hack done because someone (probably myself) was too lazy to write out
the full initialization in `AppDelegate::new`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants