uWindowCapture
uWindowCapture copied to clipboard
Window messages aren't sorted, resulting in errors when a window is only active for a single frame
When using screenshot tools like ShareX, there's weird window stuff happening: a temporary screenshot window appears for a single frame and is removed again immediately.
This seems to cause issues with the UwcManager and the window messages – sometimes the "added" messages appear after the "removed" messages, and sometimes there is no "removed" message at all.
Here's a screenshot with the events being logged - the first number is the frame index:
To reproduce:
- in UwcWindowList.cs, add "listItem.Enable();" as last line in OnWindowAdded to add every found window automatically
- download and install https://getsharex.com/
- make a screenshot with ShareX while Uwc is running
- note you'll get a broken white window (no texture)
Thank you for the report.
This bug was not actually caused by the sort order, but by the management of list items. Specifically, in this sample, it was a simple bug that the window object in Unity did not disappear when the actual window was removed.
But as you pointed out, there was a potential bug related to the sort order, so I've fixed it as well. Could you please check it?