Created
July 23, 2011 20:36
-
-
Save pingles/1101856 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
No reason- hadn't spotted that other method. Will update the gist.
Sorry, forgot to say thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why did you decide to use [[NSApplication sharedApplication] currentSystemPresentationOptions] rather than [[NSApplication sharedApplication] presentationOptions]?