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

WinUI 3 Read access conflict #9186

Open
Gaoyifei1011 opened this issue Dec 25, 2023 · 3 comments
Open

WinUI 3 Read access conflict #9186

Gaoyifei1011 opened this issue Dec 25, 2023 · 3 comments
Labels

Comments

@Gaoyifei1011
Copy link

Describe the bug

当应用窗口关闭时,会触发 Activated 事件,在此时访问 SystemBackdrop 时会提示读取访问权限冲突。

When the application window is closed, the Activated event is triggered. Against the SystemBackdrop, access conflict is prompted.

Steps to reproduce the bug

See describe

Expected behavior

The window is closed normally, and no access conflict is displayed

Screenshots

屏幕截图 2023-12-21 130114

NuGet package version

WinUI 3 - Windows App SDK 1.4.3: 1.4.231115000

Windows version

Windows 11 (22H2): Build 22621

Additional context

None

@Gaoyifei1011 Gaoyifei1011 added the bug Something isn't working label Dec 25, 2023
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Dec 25, 2023
@DarranRowe
Copy link

DarranRowe commented Dec 25, 2023

It is important to remember that the WM_ACTIVATE window message, and by extension the Window.Activated event, is used to indicate when the window is activated and deactivated.
What this means is that, surprising as it is, the underlying HWND will get a WM_ACTIVATE with WA_INACTIVE when you close a window. It is therefore no surprise to find that the Xaml runtime filters this through and triggers the Activated event one last time. If you check the WindowActivatedEventArgs.WindowActivationState property, is this properly being set as WindowActivativationState.Deactivated? If it is then you are just getting caught out by this, and you probably need to use some other means, like AppWindow.Closing to not allow any problematic code to run.

@bpulliam bpulliam added needs-author-feedback Asked author to supply more information. question and removed bug Something isn't working needs-triage Issue needs to be triaged by the area owners labels Jan 22, 2024
@Gaoyifei1011
Copy link
Author

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Please provide a relatively good solution

@microsoft-github-policy-service microsoft-github-policy-service bot added needs-triage Issue needs to be triaged by the area owners and removed needs-author-feedback Asked author to supply more information. no-recent-activity labels Jan 30, 2024
@duncanmacmichael duncanmacmichael added the bug Something isn't working label Feb 6, 2024
@bpulliam bpulliam removed bug Something isn't working needs-triage Issue needs to be triaged by the area owners labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants