source: trunk/dports/aqua/emacs-app/files/patch-lion-fullscreen.diff @ 87876

Last change on this file since 87876 was 87876, checked in by hum@…, 8 years ago

emacs-app: add lion fullscreen patch; fetch 23.3b source tarball and add livecheck as well as emacs port; take joint maintainership; see #32288, r87595.

File size: 2.1 KB
  • 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
Note: See TracBrowser for help on using the repository browser.