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

Accessing AppWindow property on Window is expensive #9321

Open
stevenbrix opened this issue Feb 7, 2024 · 2 comments
Open

Accessing AppWindow property on Window is expensive #9321

stevenbrix opened this issue Feb 7, 2024 · 2 comments
Labels
area-Windowing bug Something isn't working team-Markup Issue for the Markup team

Comments

@stevenbrix
Copy link
Contributor

Describe the bug

The Window class doesn't cache the AppWindow object, so this is showing up in our app traces

for an app that needs to access the actual HWND it is necessary to get the AppWindow object so that you can go from WindowID -> HWND

Steps to reproduce the bug

  1. write an app
  2. access AppWindow on the window

Expected behavior

i would expect this to be a simple property access and just add ref the pointer it has

Screenshots

image

NuGet package version

WinUI 3 - Windows App SDK 1.4.4: 1.4.231219000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@stevenbrix stevenbrix added the bug Something isn't working label Feb 7, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Feb 7, 2024
Copy link

github-actions bot commented Feb 7, 2024

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!

Open similar issues:

Closed similar issues:

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

@DarranRowe
Copy link

Out of curiosity, how does this compare to using IWindowNative to get the handle? This would be WinRT.Interop.WindowNative for C#.

@codendone codendone added team-Markup Issue for the Markup team area-Windowing and removed needs-triage Issue needs to be triaged by the area owners labels Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windowing bug Something isn't working team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests

3 participants