Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/nsterm.m b/src/nsterm.m
- index 827404a..5d43ca4 100644
- --- a/src/nsterm.m
- +++ b/src/nsterm.m
- @@ -4380,6 +4380,10 @@ ns_term_shutdown (int sig)
- {
- NSTRACE (applicationDidFinishLaunching);
- [NSApp setServicesProvider: NSApp];
- +
- + [NSApp setPresentationOptions:NSFullScreenWindowMask];
- + fprintf (stderr,"appDidFinishLaunching\n");
- +
- ns_send_appdefined (-2);
- }
- @@ -5471,6 +5475,9 @@ ns_term_shutdown (int sig)
- backing: NSBackingStoreBuffered
- defer: YES];
- + [win setCollectionBehavior:
- + NSWindowCollectionBehaviorFullScreenPrimary];
- +
- wr = [win frame];
- f->border_width = wr.size.width - r.size.width;
- FRAME_NS_TITLEBAR_HEIGHT (f) = wr.size.height - r.size.height;
- @@ -5559,6 +5566,32 @@ ns_term_shutdown (int sig)
- }
- +- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
- +{
- + return [[window screen] frame].size;
- +}
- +
- +- (void)windowDidEnterFullScreen:(NSNotification *)notification
- +{
- + //struct frame *emacsframe = SELECTED_FRAME ();
- +
- + NSRect r = [[self window] contentRectForFrameRect:[[self window] frame]];
- + int new_cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, r.size.width);
- + int new_rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, r.size.height);
- +
- + change_frame_size (emacsframe, new_rows, new_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 = [[self window] frame].size.width - r.size.width;
- + FRAME_NS_TITLEBAR_HEIGHT (emacsframe) =
- + [[self window] frame].size.height - r.size.height;
- +
- + [[[self window] delegate] windowDidMove:nil];
- +
- +}
- +
- +
- /* Called AFTER method below, but before our windowWillResize call there leads
- to windowDidResize -> x_set_window_size. Update emacs' notion of frame
- location so set_window_size moves the frame. */
Add Comment
Please, Sign In to add comment