diff --git a/native/Avalonia.Native/src/OSX/PopupImpl.mm b/native/Avalonia.Native/src/OSX/PopupImpl.mm index 40fe8ce88b3..f385bddfaea 100644 --- a/native/Avalonia.Native/src/OSX/PopupImpl.mm +++ b/native/Avalonia.Native/src/OSX/PopupImpl.mm @@ -42,6 +42,15 @@ virtual HRESULT Show(bool activate, bool isDialog) override return WindowBaseImpl::Show(activate, true); } + + virtual bool ShouldTakeFocusOnShow() override + { + // Don't steal the focus from another windows if our parent is inactive + if (Parent != nullptr && Parent->Window != nullptr && ![Parent->Window isKeyWindow]) + return false; + + return WindowBaseImpl::ShouldTakeFocusOnShow(); + } };