Don't throw exceptions on back-to-back window deactivations#23519
Merged
Conversation
…is valid behavior on platforms such as Windows.
PureWeen
requested changes
Jul 10, 2024
Member
PureWeen
left a comment
There was a problem hiding this comment.
Does Activated ever get fired? Like, does activated fire once and deactivated is fired twice?
Or does the window just get created and deactivated is called twice?
Would a possible fix be to not even call deactivated at all on windows for this scenario?
Like, are these deactivate calls that come from the windows platform useful at all?
Just validating if we're fixing something here that should just be a platform specific modification vs an xplat one.
PureWeen
approved these changes
Jul 10, 2024
PureWeen
requested changes
Jul 11, 2024
| !_isActivated) | ||
| { | ||
| // Don't invoke deactivated event if we're not activated. It's possible we can | ||
| // recieve this event twice if we start more than one process at a time |
Member
There was a problem hiding this comment.
Why would two processes be using the same MauiWinUIWindow?
Contributor
Author
PureWeen
approved these changes
Jul 12, 2024
|
Thank you for adressing this! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Description of Change
Don't throw exceptions on back-to-back window deactivations as this is valid behavior on platforms such as Windows (should we limit this change to just Windows?)
This is because it's possible to receive 2 "deactivate" window messages in a row if 2 child process windows are created rapidly. Each deactivate message has a parameter of the handle for the new window being created.
Issues Fixed
Fixes #22406