So i did the following:
configured plist.info:
Application is agent(UIElement)
configured to "YES" (but possibly it is for iOS only ?)
wnd.collectionBehavior = [.stationary, .canJoinAllSpaces, .fullScreenAuxiliary]
wnd.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.maximumWindow)) + 2 )
NSApp.activate(ignoringOtherApps: true)
both doing nothing!
All that can help is:
NSApp.setActivationPolicy(.prohibited)
but it is not solution for me as it's disable lot of other features and abilities of the app. =(
Is there exist some other ways to show window above fullscreen apps?
full code:
func openMainWnd(show: Bool = true) {
if mainWndController == nil {
let styleMask: NSWindow.StyleMask = [ /*.closable,.miniaturizable, .resizable, .titled*/]
let wnd = NSWindow()
wnd.styleMask = styleMask
wnd.title = "Main1"
wnd.contentView = NSHostingView(rootView: MainView(model: appVm) )
wnd.standardWindowButton(.closeButton)?.isHidden = true
wnd.standardWindowButton(.miniaturizeButton)?.isHidden = true
wnd.standardWindowButton(.zoomButton)?.isHidden = true
wnd.isMovable = false
wnd.acceptsMouseMovedEvents = true
wnd.hasShadow = true
wnd.titleVisibility = .hidden
wnd.titlebarAppearsTransparent = true
wnd.backgroundColor = .clear
wnd.collectionBehavior = [.stationary, .canJoinAllSpaces, .fullScreenAuxiliary]
wnd.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.maximumWindow)) + 2 )
NSApp.activate(ignoringOtherApps: true)
wnd.setPosition(vertical: .top(offset: MainWndConfig.topOffset), horizontal: .center)
mainWndController = NSWindowController(window: wnd)
}
if show {
mainWndController?.showWindow(mainWndController?.window)
}
}