当前位置: 动力学知识库 > 问答 > 编程问答 >

objective c - Open window such that is shows on all desktops

问题描述:

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.)

分享给朋友:
您可能感兴趣的文章:
随机阅读: