Browse Source

[OSX] ensure flyouts, menus and popups can be overlayed on fullscreen windows

pull/8154/head
Dan Walmsley 4 years ago
parent
commit
168b91fd52
  1. 16
      native/Avalonia.Native/src/OSX/AvnWindow.mm
  2. 6
      native/Avalonia.Native/src/OSX/PopupImpl.mm

16
native/Avalonia.Native/src/OSX/AvnWindow.mm

@ -174,6 +174,11 @@
[self setBackgroundColor: [NSColor clearColor]]; [self setBackgroundColor: [NSColor clearColor]];
_isExtended = false; _isExtended = false;
#ifdef IS_NSPANEL
[self setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces|NSWindowCollectionBehaviorFullScreenAuxiliary];
#endif
return self; return self;
} }
@ -212,11 +217,14 @@
// If the window has a child window being shown as a dialog then don't allow it to become the key window. // If the window has a child window being shown as a dialog then don't allow it to become the key window.
for(NSWindow* uch in [self childWindows]) for(NSWindow* uch in [self childWindows])
{ {
auto ch = static_cast<id <AvnWindowProtocol>>(uch); if (![uch conformsToProtocol:@protocol(AvnWindowProtocol)])
if(ch == nil) {
continue; continue;
if (ch.isDialog) }
return false;
id <AvnWindowProtocol> ch = (id <AvnWindowProtocol>) uch;
return !ch.isDialog;
} }
return true; return true;

6
native/Avalonia.Native/src/OSX/PopupImpl.mm

@ -50,11 +50,17 @@ protected:
return S_OK; return S_OK;
} }
} }
public: public:
virtual bool ShouldTakeFocusOnShow() override virtual bool ShouldTakeFocusOnShow() override
{ {
return false; return false;
} }
virtual HRESULT Show(bool activate, bool isDialog) override
{
return WindowBaseImpl::Show(activate, true);
}
}; };

Loading…
Cancel
Save