uWindowCapture icon indicating copy to clipboard operation
uWindowCapture copied to clipboard

Window messages aren't sorted, resulting in errors when a window is only active for a single frame

Open hybridherbst opened this issue 3 years ago • 1 comments

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: image

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)

hybridherbst avatar Oct 07 '21 18:10 hybridherbst

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?

hecomi avatar Oct 16 '21 17:10 hecomi