这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@rmadsen-ks
Copy link
Contributor

Fixed #281

Location: LayoutFloatingWindowControl.cs

The issue was fixed by specifying the UI Automation name for the root visual in the host control. This causes the GenericRootAutomationPeer to default to getting that value instead of trying to use the Win32 API to get the value of a (possibly disposed) window.

I was not able to figure out how to solve the root cause which is caused by GCHandles to the Border (RootVisual) still hanging around after the window is closed. Since the UI Automation uses WeakReferences to check which elements are still alive, this issue could also be solved by clearing all references to the RootVisual object, but that is easier said than done.

I was not able to reproduce the issue with a simple UI that I can share. Probably this issue is caused by some unfortunate interactions between our UI Style library and AvalonDock - so the complex interactions of large systems.

Anyway, the fix seems low risk, so I hope you can accept it.

@Dirkster99 Dirkster99 merged commit b83d6d6 into Dirkster99:master Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception thrown: 'System.ComponentModel.Win32Exception' in WindowsBase.dll (Invalid window handle)

2 participants