Browse Source

Visiblity check fix

Nikita Tsukanov 3 years ago
parent
commit
f0989357a0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Avalonia.Base/Rendering/Composition/Visual.cs

+ 2 - 2
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)