【发布时间】:2011-10-31 13:53:17
【问题描述】:
在 Cocoa 应用程序中,有没有办法判断另一个应用程序当前是否处于全屏模式?
我的应用程序被配置为显示在所有空间上并侦听mouseEntered 事件以将自己排在前面。
问题是当另一个应用程序处于全屏模式并且用户碰巧将鼠标移动到我的应用程序窗口所在的黑色区域时,它会被带到前面(发生在多个监视器上)。
我只看到启用[self setCollectionBehavior: NSWindowCollectionBehaviorCanJoinAllSpaces]; 的上述行为。
这里是我的应用程序的其他相关代码。
- (void) mouseEntered:(NSEvent *)theEvent
{
// Don't do this when another app is in full screen mode:
[[self window] orderFront:self];
}
【问题讨论】:
-
检查这两个链接 - 他们可能会给你一个提示:stackoverflow.com/questions/633086/detecting-fullscreen-on-mac AND stackoverflow.com/questions/6815917/…
标签: cocoa fullscreen nswindow osx-lion