Cocoa-ified Emacs Fullscreen in OSX Lion

I’ve got a mostly working patch for Homebrew’s Emacs recipe that will build Emacs with a Cocoa interface that supports OSX Lion’s new full-screen mode. I’m posting here so someone else can beat me to it. I know Emacs already has full-screen, this was definitely an exercise in yak-shaving.

It doesn’t quite fill the screen (there’s still some weird height/width calculation bits in EmacsWindow I’ve not gotten my head around yet). It also messes up the screen size when you move back out of full-screen mode.

The following gist includes the full emacs.rb recipe (which adds a command to patch with the above diff).

7 responses
Did you submit this to upstream Emacs?
Hi,

I haven't, no. It's still not quite working perfectly- the full-screen doesn't actually fill the screen, and when you exit full-screen mode you need to resize to draw the status bars. I was hoping to either fix it, or, to have some other people take on the challenge before putting it into the Homebrew formula.

I spent a couple of evenings trying to fix the fullscreen issue. It seems to be a problem with the Emacs toolbar. When an app goes fullscreen, Lion enables the toolbar, but then Emacs gets confused because it thinks the toolbar is still hidden. I've given up for now :(

And to fix the resize, you can probably just implement windowDidExitFullscreen, and tell emacs to resize.

Paul, based on your patch and the previous fullscreen patch (gist:1012927) I wrote a new one that solves the problems you describe. The patch is available at https://gist.github.com/1355895. Note that I did not try to combine my patch with gist:1012927.
Fantastic, works great for me!
Have I mentioned lately that I love you, Pingles?

I love you, Pingles.

I miss you too Steve