Skip to content

Instantly share code, notes, and snippets.

@ninjudd
Forked from rust/emacs.rb
Created September 15, 2011 14:33
Show Gist options
  • Save ninjudd/1219385 to your computer and use it in GitHub Desktop.
Save ninjudd/1219385 to your computer and use it in GitHub Desktop.
Homebrew Emacs for OSX Lion with native full-screen
diff --git a/src/nsterm.m b/src/nsterm.m
index 5348b20..a0c808e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1162,7 +1162,9 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
f->scroll_bar_actual_width = NS_SCROLL_BAR_WIDTH (f);
compute_fringe_widths (f, 0);
- if ([window isKindOfClass:[EmacsFullWindow class]]) {
+ BOOL inFullScreen = ([window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask;
+
+ if ([window isKindOfClass:[EmacsFullWindow class]] || inFullScreen) {
pixelwidth = [[window screen] frame].size.width;
pixelheight = [[window screen] frame].size.height;
}
@@ -5189,6 +5191,11 @@ ns_term_shutdown (int sig)
[self allocateGState];
+ NSApplicationPresentationOptions options = [[NSApplication sharedApplication] presentationOptions];
+ [[NSApplication sharedApplication] setPresentationOptions:options | NSApplicationPresentationFullScreen];
+
+ [win setCollectionBehavior:[win collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
+
ns_window_num++;
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment