| 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 | |