From f0989357a01a1df28ad5b522aad180e08d5e539f Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Thu, 26 May 2022 15:29:56 +0300 Subject: [PATCH] Visiblity check fix --- src/Avalonia.Base/Rendering/Composition/Visual.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Base/Rendering/Composition/Visual.cs b/src/Avalonia.Base/Rendering/Composition/Visual.cs index f7c8078073..fa8d5d8f3b 100644 --- a/src/Avalonia.Base/Rendering/Composition/Visual.cs +++ b/src/Avalonia.Base/Rendering/Composition/Visual.cs @@ -45,8 +45,8 @@ namespace Avalonia.Rendering.Composition var i = Root.Server.Readback; ref var readback = ref Server.GetReadback(i.ReadIndex); - // CompositionVisual wasn't visible - if (readback.Revision < i.ReadRevision) + // CompositionVisual wasn't visible or wasn't even attached to the composition target during the lat frame + if (!readback.Visible || readback.Revision < i.ReadRevision) return null; // CompositionVisual was reparented (potential race here)