diff --git a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm index afae6d6b5b..012fc5fcfd 100644 --- a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm @@ -106,6 +106,13 @@ HRESULT WindowBaseImpl::Show(bool activate, bool isDialog) { _shown = true; [Window setCollectionBehavior:collectionBehavior]; + + // Ensure that we call needsDisplay = YES so that AvnView.updateLayer is called after the + // window is shown: if the client is pumping messages during the window creation/show + // process, it's possible that updateLayer gets called after the window is created but + // before it's is shown. + [View.layer setNeedsDisplay]; + return S_OK; } }