github.com/secoba/wails/v2@v2.6.4/internal/frontend/desktop/darwin/WindowDelegate.m (about) 1 //go:build darwin 2 // 3 // WindowDelegate.m 4 // test 5 // 6 // Created by Lea Anthony on 10/10/21. 7 // 8 9 #import <Foundation/Foundation.h> 10 #import <Cocoa/Cocoa.h> 11 #import "WindowDelegate.h" 12 #import "message.h" 13 #import "WailsContext.h" 14 15 @implementation WindowDelegate 16 - (BOOL)windowShouldClose:(WailsWindow *)sender { 17 if( self.hideOnClose ) { 18 [NSApp hide:nil]; 19 return false; 20 } 21 processMessage("Q"); 22 return false; 23 } 24 25 - (void)windowDidExitFullScreen:(NSNotification *)notification { 26 [self.ctx.mainWindow applyWindowConstraints]; 27 } 28 29 - (void)windowWillEnterFullScreen:(NSNotification *)notification { 30 [self.ctx.mainWindow disableWindowConstraints]; 31 } 32 33 - (NSApplicationPresentationOptions)window:(WailsWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions { 34 return NSApplicationPresentationAutoHideToolbar | NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationFullScreen; 35 } 36 37 38 @end