Created
June 11, 2012 09:38
-
-
Save henry0312/2909327 to your computer and use it in GitHub Desktop.
Fix typester's emacs-23-lion-fullscreen-test.patch to follow Emacs 24.1
This file contains 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 | |
--- a/src/nsterm.m | |
+++ b/src/nsterm.m | |
@@ -5507,6 +5507,7 @@ ns_term_shutdown (int sig) | |
[win setAcceptsMouseMovedEvents: YES]; | |
[win setDelegate: self]; | |
[win useOptimizedDrawing: YES]; | |
+ [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; | |
sz.width = FRAME_COLUMN_WIDTH (f); | |
sz.height = FRAME_LINE_HEIGHT (f); | |
@@ -6022,6 +6023,43 @@ ns_term_shutdown (int sig) | |
cols = c; | |
} | |
+- (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions { | |
+ return proposedOptions | NSApplicationPresentationAutoHideToolbar; | |
+} | |
+ | |
+- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize { | |
+ NSRect r = NSMakeRect(0.f, 0.f, proposedSize.width, proposedSize.height); | |
+ int cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, r.size.width); | |
+ int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, r.size.height); | |
+ | |
+ change_frame_size (emacsframe, rows, cols, 0, 1, 0); /* pretend, delay, safe */ | |
+ FRAME_PIXEL_WIDTH (emacsframe) = (int)r.size.width; | |
+ FRAME_PIXEL_HEIGHT (emacsframe) = (int)r.size.height; | |
+ | |
+ emacsframe->border_width = [window frame].size.width - r.size.width; | |
+ FRAME_NS_TITLEBAR_HEIGHT (emacsframe) = 0; | |
+ | |
+ return proposedSize; | |
+} | |
+ | |
+- (void)windowDidExitFullScreen:(NSNotification *)notification { | |
+ NSWindow* window = [notification object]; | |
+ | |
+ NSRect r = [window contentRectForFrameRect:[window frame]]; | |
+ int cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, r.size.width); | |
+ int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, r.size.height); | |
+ | |
+ change_frame_size (emacsframe, rows, cols, 0, 1, 0); /* pretend, delay, safe */ | |
+ FRAME_PIXEL_WIDTH (emacsframe) = (int)r.size.width; | |
+ FRAME_PIXEL_HEIGHT (emacsframe) = (int)r.size.height; | |
+ | |
+ emacsframe->border_width = [window frame].size.width - r.size.width; | |
+ FRAME_NS_TITLEBAR_HEIGHT (emacsframe) = | |
+ [window frame].size.height - r.size.height; | |
+ | |
+ [[window delegate] windowDidMove:nil]; | |
+} | |
+ | |
@end /* EmacsView */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
emacs-23-lion-fullscreen-test.patch
https://github.com/downloads/typester/emacs/emacs-23-lion-fullscreen-test.patch