43 Folders

Back to Work

Merlin’s weekly podcast with Dan Benjamin. We talk about creativity, independence, and making things you love.

Join us via RSS, iTunes, or at 5by5.tv.

”What’s 43 Folders?”
43Folders.com is Merlin Mann’s website about finding the time and attention to do your best creative work.

Open Thread: Developing for Full Screen Mode?

Full Screen Mode is a topic that comes up a lot here and abroad -- it's a way to set a given application to operate with as few menus, panels, and other navigational widgets as possible, claiming the entire screen, and enabling the user to focus exclusively on one task without distraction.

Essentially, it temporarily hobbles your maddeningly versatile Mac into a machine for doing exactly one thing, being whatever is appearing in your single Full Screen window. And you might be amazed what a nice thing that can be sometimes. It's great for writers in particular, so it's perhaps not surprising that writing applications seem to be leading the Full Screen charge. Although you can also get FSM in Firefox using extensions and in Safari with the help of Saft.

So my question, for you Mac developers in the house: I'm curious to learn more about Full Screen mode and how hard it is to make it a part of Cocoa applications. I've gotten the impression that Cocoa has "hooks" in place to hide the Menu Bar and claim all the screen space with a given document's front window, so I'm curious whether it's something that's difficult to implement. I'd love to request it in some favorite applications of mine (Hi, again, Allan!). What do you guys say? Piece of cake or pony?

Fraser Speirs's picture

Hmmm, what's required? You subclass NSWindow...

Hmmm, what's required?

You subclass NSWindow and override - (BOOL)canBecomeKeyWindow to return YES.

Then you instantiate it, passing NSBorderlessWindowMask as the styleMask parameter of a call to NSWindow's -initWithContentRect:styleMask:backing:defer:screen: initializer.

Then you probably want to pass something like CGShieldingWindowLevel() to NSWindow's -setLevel: method before setting the window's frame (CORRECTLY handling the case where -[NSScreen screens] returns an array of more than one item (i.e. you're on a dual display box)) and putting it on-screen.

Oh, and don't forget to capture some keystroke so people can get out of your fullscreen world!

 
EXPLORE 43Folders THE GOOD STUFF

Popular
Today

Popular
Classics

An Oblique Strategy:
Honor thy error as a hidden intention


STAY IN THE LOOP:

Subscribe with Google Reader

Subscribe on Netvibes

Add to Technorati Favorites

Subscribe on Pageflakes

Add RSS feed

The Podcast Feed

Cranking

Merlin used to crank. He’s not cranking any more.

This is an essay about family, priorities, and Shakey’s Pizza, and it’s probably the best thing he’s written. »

Scared Shitless

Merlin’s scared. You’re scared. Everybody is scared.

This is the video of Merlin’s keynote at Webstock 2011. The one where he cried. You should watch it. »