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

Context flyout: SecondWindow get_Content throws System.Runtime.InteropServices.COMException: The WinUI Desktop Window object has already been closed. #175

Open
m1adow opened this issue Oct 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@m1adow
Copy link

m1adow commented Oct 17, 2024

Describe the bug

Hi! My customer experienced this crash. I cannot reproduce it, but could you assist me in fixing it or at least provide some information about it?

Steps to reproduce the bug

I don't have the exact steps, but I have StackTrace for this exception:

image

ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0 (Int32 hr)
System.Runtime.InteropServices.COMException: Invalid operation identifier. The WinUI Desktop Window object has already been closed.

Problematic line:
flyout.ShowAt(window.Content, new FlyoutShowOptions

I was looking at your implementation in "src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs" I can guess that somewhere the window is closed. Do you have any idea about it?

Expected behavior

No exception throw

Screenshots

No response

NuGet package version

2.1.3

Platform

WinUI

IDE

Visual Studio 2022

Windows Version

Windows 11

WindowsAppSDK Version

Other

WindowsAppSDK Type

Packaged

Manifest

No response

Additional context

No response

@m1adow m1adow added the bug Something isn't working label Oct 17, 2024
@HavenDV
Copy link
Owner

HavenDV commented Oct 17, 2024

We can try to recover from this if an exception occurs. The big problem here is that different versions of Windows and WindowsAppSDK create a large matrix, which can have bugs at different points in time. And it is incredibly difficult to support this without large investments in creating UI tests for this entire matrix. And even so, it can still fall over time due to some reasons like sleep/wake up, for example.
I am unlikely to be able to do this for free anytime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants