From 546a95c673eb70aac1d15dea8d2bad8e5b31da90 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Tue, 19 Aug 2025 14:01:58 +0500 Subject: [PATCH] Schedule a full render pass on CompositionBatchCompletion to prevent tearing (#19487) --- .../Media/MediaContext.Compositor.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Avalonia.Base/Media/MediaContext.Compositor.cs b/src/Avalonia.Base/Media/MediaContext.Compositor.cs index 69663d33b9..984e4205e5 100644 --- a/src/Avalonia.Base/Media/MediaContext.Compositor.cs +++ b/src/Avalonia.Base/Media/MediaContext.Compositor.cs @@ -49,24 +49,12 @@ partial class MediaContext { _animationsAreWaitingForComposition = false; - // Check if we have uncommited changes - if (_requestedCommits.Count != 0) - { - if (!CommitCompositorsWithThrottling()) - ScheduleRenderForAnimationsIfNeeded(); - - } - // Check if there are active animations and schedule the next render - else - ScheduleRenderForAnimationsIfNeeded(); + // Check if we have requested commits or active animations and schedule a new render pass + if (_requestedCommits.Count != 0 || _clock.HasSubscriptions) + ScheduleRender(false); } } - void ScheduleRenderForAnimationsIfNeeded() - { - if (_clock.HasSubscriptions) - ScheduleRender(false); - } /// /// Triggers a composition commit if any batches are waiting to be sent,