Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Core/src/Platform/Windows/MauiWinUIWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ protected virtual void OnActivated(object sender, UI.Xaml.WindowActivatedEventAr
else
_enableResumeEvent = true;
}
else if (args.WindowActivationState == UI.Xaml.WindowActivationState.Deactivated &&
!_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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why would two processes be using the same MauiWinUIWindow?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, they're not the same MauiWinUIWindow: starting any process that has a window will send a window message back to the window of the process that started it:
image

return;
}
else
{
_isActivated = false;
Expand Down