-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Crash upon resuming the app 'window was already activated' #21948
Comments
Verified on VS 17.10.0 Preview 4.0(8.0.20). Can repro this issue on iOS 17.2. |
I've added the repro to our sandbox project here https://github.com/dotnet/maui/tree/fix_21948 The bug here is that our code that searches for the keywindow doesn't work because mopups is using it's own UIWindow So when our life cycle code tries to search for the keywindow it doesn't return anything. Some possible thoughts on fixes
we should probably do one regardless if two is a better solution for this scenario |
Workaround |
@PureWeen |
I have added below in OnActivated, this is helping as a work around for scenario mentioned in previous comment: public override void OnActivated(UIApplication application)
{
base.OnActivated(application);
if (Application.Windows.FirstOrDefault() is App.WindowFix windowFix && !windowFix.IsActivated)
{
(windowFix as IWindow).Activated();
}
} |
* [iOS] Crash upon resuming the app - fix (#21948) * Refactor * Update UIApplicationExtensions.cs * Update UIApplicationExtensions.cs * Update UIApplicationExtensions.cs * Added a UI test (#21948) * Added a test category (#23428) * remove "'" --------- Co-authored-by: Shane Neuville <[email protected]>
Description
when we minimize the app and then restore it, we get a 'window was already activated' crash.
This takes place when we are showing a popup page, and then close this popup page (with a slight delay) and immediately minimize the app then restore it.
Please see the repro project and follow the repro steps.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/ESO-ST/WebViewCrashMidLoad/tree/WindowWasAlreadyActivatedCrash
https://github.com/dotnet/maui/tree/fix_21948
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
no
Relevant log output
No response
The text was updated successfully, but these errors were encountered: