Skip to content

Instantly share code, notes, and snippets.

@pingles
Created July 23, 2011 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pingles/1101856 to your computer and use it in GitHub Desktop.
Save pingles/1101856 to your computer and use it in GitHub Desktop.
diff --git a/src/nsterm.m b/src/nsterm.m
index e768c24..5bf6ce3 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1161,8 +1161,10 @@ 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);
+
+ BOOL inFullScreen = ([window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask;
- if ([window isKindOfClass:[EmacsFullWindow class]]) {
+ if ([window isKindOfClass:[EmacsFullWindow class]] || inFullScreen) {
pixelwidth = [[window screen] frame].size.width;
pixelheight = [[window screen] frame].size.height;
}
@@ -1228,6 +1230,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
? NSMakePoint (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)
- NS_SCROLL_BAR_WIDTH (f), 0)
: NSMakePoint (0, 0);
+
[view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)];
[view setBoundsOrigin: origin];
@@ -5119,7 +5122,8 @@ ns_term_shutdown (int sig)
win = [[EmacsWindow alloc]
initWithContentRect: r
- styleMask: (NSResizableWindowMask |
+ styleMask: (NSTitledWindowMask |
+ NSResizableWindowMask |
NSMiniaturizableWindowMask |
NSClosableWindowMask)
backing: NSBackingStoreBuffered
@@ -5184,6 +5188,11 @@ ns_term_shutdown (int sig)
[win setOpaque: NO];
[self allocateGState];
+
+ NSApplicationPresentationOptions options = [[NSApplication sharedApplication] presentationOptions];
+ [[NSApplication sharedApplication] setPresentationOptions:options | NSApplicationPresentationFullScreen];
+
+ [win setCollectionBehavior:[win collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
ns_window_num++;
return self;
@Kentzo
Copy link

Kentzo commented Aug 17, 2011

Why did you decide to use [[NSApplication sharedApplication] currentSystemPresentationOptions] rather than [[NSApplication sharedApplication] presentationOptions]?

@pingles
Copy link
Author

pingles commented Aug 17, 2011

No reason- hadn't spotted that other method. Will update the gist.

@pingles
Copy link
Author

pingles commented Aug 17, 2011

Sorry, forgot to say thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment