2
votes

I've got a small window that has no borders, titlebar, buttons, etc. I want to support full -screen mode (the new Lion kind) and I basically have all that working -- I can switch into and out of fullscreen mode and the window resizes itself, etc, no problems.

However, when I move the mouse to the top of the screen, the Menu bar with the icon to close the full screen mode does not slide down.

How do I get that working? Is it keyed off a style mask? Something else?

2
Does the behavior change when you add a title bar? - jtbandes
Tried adding the title bar back to the original window (along with the close buttons, resizable mask, etc) and no effect :( - MarcWan
And I assume fullscreen works normally for you in other apps? Are you doing anything strange with event handling in this app? - jtbandes
A-ha, the key is in what you return for - (NSApplicationPresentationOptions)window: (NSWindow *)window willUseFullScreenPresentationOptions: (NSApplicationPresentationOptions)proposedOptions Need to add NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationHideDock to the returned values. Gaa. - MarcWan

2 Answers

1
votes

A-ha, the key is in what you return for

 - (NSApplicationPresentationOptions)window: (NSWindow *)window willUseFullScreenPresentationOptions: (NSApplicationPresentationOptions)proposedOptions

You need to add NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationHideDock to the returned values in addition to NSApplicationPresentationFullScreen.

0
votes

The only thing you need to do to make full screen mode work in Lion is to call ‑setCollectionBehavior: on your window and pass in NSWindowCollectionBehaviorFullScreenPrimary.

You don't need to do anything else. All the kiosk-mode stuff is not necessary unless you are targeting 10.6 or earlier.