Browse Source

Reset expected commit callback timing after waiting for app exiting idle (#21157)

release/latest
Nikita Tsukanov 5 months ago
committed by Julien Lebosquain
parent
commit
868b8df25c
  1. 5
      src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositorConnection.cs

5
src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositorConnection.cs

@ -127,7 +127,12 @@ internal class WinUiCompositorConnection : IRenderTimer, Win32.IWindowsSurfaceFa
// Always schedule a commit so the current frame's work reaches DWM.
ScheduleNextCommit();
if (_parent._stopped)
{
_parent._wakeEvent.WaitOne();
// Reset the expected commit callback time since we've paused
// the render loop due to app being idle
_commitDueAt = _st.Elapsed + TimeSpan.FromSeconds(1);
}
}
private void ScheduleNextCommit()

Loading…
Cancel
Save