I set the app windows to floating, to keep them on top:
NSApplication.shared.windows.forEach { window in
window.level = .floating
}
However, this disables the fullscreen mode:
Can these two behaviors (floating windows & fullscreen mode) be enabled in parallel? I have checked project settings and developer docs, but didn't find anything.
I got it to work by setting collectionBehavior
:
NSApplication.shared.windows.forEach { window in
window.collectionBehavior = [.fullScreenPrimary]
window.level = .floating
}
I found a similar SO question , they also set some properties (not the level
) of the window, and fullscreen gets disabled.
So is it that if collectionBehavior
is not specified for an NSWindow, then fullscreen is enabled as long as certain NSWindow properties (eg level
) are not explicitly set?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.