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

Multiple Windows support on iPadOS #435

Open
S0ulf3re opened this issue May 15, 2022 · 5 comments
Open

Multiple Windows support on iPadOS #435

S0ulf3re opened this issue May 15, 2022 · 5 comments
Labels
suggestion Feature suggestion

Comments

@S0ulf3re
Copy link

It would be nice to have support for multiple windows on iPad. I know that Tweetbot supports this function and adding it would allow us to use multiple accounts with Mastodon at the same time. It could also be useful for moderators as well

@MainasuK MainasuK added the suggestion Feature suggestion label May 24, 2022
@MainasuK
Copy link
Contributor

The app implementation not consider this feature. I'm not sure how many people using multiple windows feature on iPad. And I think it's needs some efforts to make it.

@S0ulf3re
Copy link
Author

Desperately wanting this feature, I ponied up the 99$ developer fee and compiled the app myself with "Supports Multiple Windows" Toggled to "YES". And surprisingly, with no changes to the code required, it seems to work in the Simulator. About to test it on my iPad, just gotta fix one little problem with app groups over in MastodonSDK

@S0ulf3re
Copy link
Author

Ok, so I solved the problem (turns out I forgot to change the appGroup variable) and so far, mastodon is running very well on my iPad after compiling on the main branch with "Enable Multiple Windows" set to "YES".

IMG_731A986C9DB3-1

Seeing as though that Mastodon is built with SceneDelegate, optimizing mastodon for Multiple Windows should be relatively easy.

@S0ulf3re
Copy link
Author

S0ulf3re commented Jul 20, 2022

Things that don't seem to work:

  • Browsing with multiple accounts
    This doesn't seem to work. If you switch accounts from the profile selector, it updates each and every window to where you last left off on the home tab. This is probably not a big deal, but should this feature ever see the light in the main App Store app (Which I really hope it does, since it's useful for bookmarking. Or especially useful for lists should they be added).

  • Reopen Closed Window

Within App Exposé in the app switcher (accessed by selecting the two squares icon by an app windows name), whenever a window is closed by swiping it upward, an option appears to "Reopen Closed Window" by the + button. When tapped however, this seems to terminate the entire app (and subsequently, all of its windows) causing them all to lose their position.

Although I haven't tested this, my hypothesis for other potential problems that would cause them to lose state would be background app terminations, as well as system restarts (similar to macOS).

@MainasuK
Copy link
Contributor

MainasuK commented Aug 2, 2022

Hi @S0ulf3re,

Sorry for the late reply. The first version of this app supports hot reloading the active user. But that may cause leaking. And the app actually reset the window to force reload the app now.

To makes the multiple windows work. We need to add an additional layer to handle the authentication info alongside the AppContext. A good place the inject it is SceneCoordinator. The coordinator could present the Onboarding scene when no authentication is available. And reset to normal app after user login. Then inject this into every ViewController & ViewModel.

I'm making some exploration on that project. A PR with that concept will be finished recently. But that needs a lot of work to refactor and migrate back to the Mastodon app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

2 participants