FROM : Ken Thomases
DATE : Mon Apr 21 20:08:49 2008
On Apr 21, 2008, at 7:24 AM, Peter Hoerster wrote:
> is there a method to detect from the background if a foreground
> program is running in fullscreen mode?
> I have to hide a floating panel when a video or game software is
> running fullscreen.
It depends on what you mean by fullscreen mode. Most programs which
have a fullscreen mode capture the display(s) with CGDisplayCapture*
() or CGCaptureAllDisplays*(). If they do that, then I don't think
you have to worry about it -- by design, the GUI of other
applications won't display and they won't be informed of the change
in display configuration. (That's the point of capturing the
display. You don't want the Finder to rearrange all of your desktop
icons when you change resolutions, for example.)
If by fullscreen mode you mean that the frontmost application has
hidden the menubar and Dock via SetSystemUIMode, then you may need to
monitor the mode by installing a Carbon event handler for the
kEventAppSystemUIModeChanged event. I assume, but can't be sure,
that [NSMenu setMenuBarVisible:NO] uses SetSystemUIMode under the
hood, and thus generates the same Carbon event.
Cheers,
Ken
DATE : Mon Apr 21 20:08:49 2008
On Apr 21, 2008, at 7:24 AM, Peter Hoerster wrote:
> is there a method to detect from the background if a foreground
> program is running in fullscreen mode?
> I have to hide a floating panel when a video or game software is
> running fullscreen.
It depends on what you mean by fullscreen mode. Most programs which
have a fullscreen mode capture the display(s) with CGDisplayCapture*
() or CGCaptureAllDisplays*(). If they do that, then I don't think
you have to worry about it -- by design, the GUI of other
applications won't display and they won't be informed of the change
in display configuration. (That's the point of capturing the
display. You don't want the Finder to rearrange all of your desktop
icons when you change resolutions, for example.)
If by fullscreen mode you mean that the frontmost application has
hidden the menubar and Dock via SetSystemUIMode, then you may need to
monitor the mode by installing a Carbon event handler for the
kEventAppSystemUIModeChanged event. I assume, but can't be sure,
that [NSMenu setMenuBarVisible:NO] uses SetSystemUIMode under the
hood, and thus generates the same Carbon event.
Cheers,
Ken
| Related mails | Author | Date |
|---|---|---|
| Peter Hoerster | Apr 21, 14:24 | |
| Ken Thomases | Apr 21, 20:08 |






Cocoa mail archive

