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

The Window.Activated event fires twice after maximizing a minimized window #7343

Closed
Tracked by #7894
PureWeen opened this issue Jul 5, 2022 · 5 comments
Closed
Tracked by #7894
Assignees
Labels
area-App activation bug Something isn't working fix-released The fix has been in a release (experimental, preview, stable, or servicing). fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. product-winui3 WinUI 3 issues team-Reach Issue for the Reach team
Milestone

Comments

@PureWeen
Copy link

PureWeen commented Jul 5, 2022

Describe the bug

If you minimize a window and then maximize it you will get two symmetrical Activated events

// Minimize window

OnActivated. WindowActivationState: Deactivated Handled: False Microsoft.UI.Xaml.WindowActivatedEventArgs

// Maximize Window

OnActivated. WindowActivationState: CodeActivated Handled: False Microsoft.UI.Xaml.WindowActivatedEventArgs
OnActivated. WindowActivationState: CodeActivated Handled: False Microsoft.UI.Xaml.WindowActivatedEventArgs

I tested this behavior on UWP and on UWP it only fires one event when maximizing the window.

Steps to reproduce the bug

App86.zip

I've added an activated event to the window
image

  1. Minimize the window
  2. Maximize the window

You'll see two messages logged during the Maximize phase.

Expected behavior

Only one CodeActivated event should fire when maximizing the window.

Screenshots

No response

NuGet package version

1.1.0

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 21H2 (22000)

IDE

No response

Additional context

No response

@PureWeen PureWeen changed the title The Window.Activated event fires twice when maximizes an application The Window.Activated event fires twice after maximizing a minimized window Jul 5, 2022
@btueffers btueffers added bug Something isn't working area-App activation labels Jul 7, 2022
@btueffers btueffers assigned brialmsft and unassigned brialmsft Jul 7, 2022
@btueffers btueffers transferred this issue from microsoft/WindowsAppSDK Jul 8, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jul 8, 2022
@ojhad ojhad added team-Reach Issue for the Reach team product-winui3 WinUI 3 issues labels Jul 11, 2022
@pratikone pratikone self-assigned this Nov 16, 2022
@pratikone
Copy link
Contributor

Thanks for reporting this. this is indeed an issue. I have debugged it and found the root cause. Will be working on fixing ti

@mattleibow
Copy link

Internal issue tracked here: https://dev.azure.com/microsoft/OS/_workitems/edit/40416912

@pratikone
Copy link
Contributor

@mattleibow thanks. you can use task.ms to track internal issues on public repos.

@axa88
Copy link

axa88 commented Aug 9, 2023

Windows version

Windows 11 version 21H2 (22000)

fwiw I can affirm that this issue appears to affect Android as well.

@pratikone
Copy link
Contributor

Ok, finally was able to get this in. I think it will be part of 1.6. It took a while because it was a breaking change and we needed to time it.

@pratikone pratikone added the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Mar 11, 2024
@codendone codendone added this to the WinAppSDK 1.6 milestone May 23, 2024
@codendone codendone added the fix-released The fix has been in a release (experimental, preview, stable, or servicing). label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-App activation bug Something isn't working fix-released The fix has been in a release (experimental, preview, stable, or servicing). fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. product-winui3 WinUI 3 issues team-Reach Issue for the Reach team
Projects
None yet
Development

No branches or pull requests

8 participants