diff --git a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm index 3f54680ae7..ce8b5e1698 100644 --- a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm @@ -132,6 +132,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; } }