Ticket #32288: patch-lion-fullscreen.diff

File patch-lion-fullscreen.diff, 2.1 KB (added by humem (humem), 13 years ago)
  • src/nsterm.m

    old new  
    51825182  [win setAcceptsMouseMovedEvents: YES];
    51835183  [win setDelegate: self];
    51845184  [win useOptimizedDrawing: YES];
     5185  [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
    51855186
    51865187  sz.width = FRAME_COLUMN_WIDTH (f);
    51875188  sz.height = FRAME_LINE_HEIGHT (f);
     
    56715672  cols = c;
    56725673}
    56735674
     5675- (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions {
     5676    return proposedOptions | NSApplicationPresentationAutoHideToolbar;
     5677}
     5678
     5679- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize {
     5680    NSRect r = NSMakeRect(0.f, 0.f, proposedSize.width, proposedSize.height);
     5681    int cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, r.size.width);
     5682    int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, r.size.height);
     5683
     5684    change_frame_size (emacsframe, rows, cols, 0, 1, 0); /* pretend, delay, safe */
     5685    FRAME_PIXEL_WIDTH (emacsframe) = (int)r.size.width;
     5686    FRAME_PIXEL_HEIGHT (emacsframe) = (int)r.size.height;
     5687
     5688    emacsframe->border_width = [window frame].size.width - r.size.width;
     5689    FRAME_NS_TITLEBAR_HEIGHT (emacsframe) = 0;
     5690
     5691    return proposedSize;
     5692}
     5693
     5694- (void)windowDidExitFullScreen:(NSNotification *)notification {
     5695    NSWindow* window = [notification object];
     5696
     5697    NSRect r = [window contentRectForFrameRect:[window frame]];
     5698    int cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, r.size.width);
     5699    int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, r.size.height);
     5700
     5701    change_frame_size (emacsframe, rows, cols, 0, 1, 0); /* pretend, delay, safe */
     5702    FRAME_PIXEL_WIDTH (emacsframe) = (int)r.size.width;
     5703    FRAME_PIXEL_HEIGHT (emacsframe) = (int)r.size.height;
     5704
     5705    emacsframe->border_width = [window frame].size.width - r.size.width;
     5706    FRAME_NS_TITLEBAR_HEIGHT (emacsframe) =
     5707        [window frame].size.height - r.size.height;
     5708
     5709    [[window delegate] windowDidMove:nil];
     5710}
     5711
    56745712@end  /* EmacsView */
    56755713
    56765714