问题描述:

I have a screenshot thing, what it does is it takes a screenshot of the current visible stuff, then opens a full screen window covering everything. However this opens on the desktop of the parent window which is on desktop 1. And if a user had desktop 2 focused (due to like fullscreen app or something) then the window that opened will not show on desktop 2.

So I was wondering if there is a window level or something (I tried all the window levels) that will make it such that a window appears on all desktops.

Thanks

网友答案:

This sounds like either NSWindowCollectionBehaviorCanJoinAllSpaces or NSWindowCollectionBehaviorStationary. Set it as the collectionBehavior of the window.

(You probably want to set the window level, too, but that's about ordering rather than collection/Spaces behavior. And if you have a Window menu, then you probably also want NSWindowCollectionBehaviorIgnoresCycle.)

相关阅读:
Top