Guest User

Untitled

a guest
Jan 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. diff --git a/src/nsterm.m b/src/nsterm.m
  2. index 827404a..5d43ca4 100644
  3. --- a/src/nsterm.m
  4. +++ b/src/nsterm.m
  5. @@ -4380,6 +4380,10 @@ ns_term_shutdown (int sig)
  6. {
  7. NSTRACE (applicationDidFinishLaunching);
  8. [NSApp setServicesProvider: NSApp];
  9. +
  10. + [NSApp setPresentationOptions:NSFullScreenWindowMask];
  11. + fprintf (stderr,"appDidFinishLaunching\n");
  12. +
  13. ns_send_appdefined (-2);
  14. }
  15.  
  16. @@ -5471,6 +5475,9 @@ ns_term_shutdown (int sig)
  17. backing: NSBackingStoreBuffered
  18. defer: YES];
  19.  
  20. + [win setCollectionBehavior:
  21. + NSWindowCollectionBehaviorFullScreenPrimary];
  22. +
  23. wr = [win frame];
  24. f->border_width = wr.size.width - r.size.width;
  25. FRAME_NS_TITLEBAR_HEIGHT (f) = wr.size.height - r.size.height;
  26. @@ -5559,6 +5566,32 @@ ns_term_shutdown (int sig)
  27. }
  28.  
  29.  
  30. +- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
  31. +{
  32. + return [[window screen] frame].size;
  33. +}
  34. +
  35. +- (void)windowDidEnterFullScreen:(NSNotification *)notification
  36. +{
  37. + //struct frame *emacsframe = SELECTED_FRAME ();
  38. +
  39. + NSRect r = [[self window] contentRectForFrameRect:[[self window] frame]];
  40. + int new_cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, r.size.width);
  41. + int new_rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, r.size.height);
  42. +
  43. + change_frame_size (emacsframe, new_rows, new_cols, 0, 1, 0); /* pretend, delay, safe */
  44. + FRAME_PIXEL_WIDTH (emacsframe) = (int)r.size.width;
  45. + FRAME_PIXEL_HEIGHT (emacsframe) = (int)r.size.height;
  46. +
  47. + emacsframe->border_width = [[self window] frame].size.width - r.size.width;
  48. + FRAME_NS_TITLEBAR_HEIGHT (emacsframe) =
  49. + [[self window] frame].size.height - r.size.height;
  50. +
  51. + [[[self window] delegate] windowDidMove:nil];
  52. +
  53. +}
  54. +
  55. +
  56. /* Called AFTER method below, but before our windowWillResize call there leads
  57. to windowDidResize -> x_set_window_size. Update emacs' notion of frame
  58. location so set_window_size moves the frame. */
Add Comment
Please, Sign In to add comment