5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 16:52:07 +08:00

window delegate modify for onBeforeClose hook

This commit is contained in:
ironpark 2021-12-04 07:52:34 +09:00
parent fda3323386
commit 92b63d9fad

View File

@ -12,16 +12,15 @@
#import "WailsContext.h" #import "WailsContext.h"
@implementation WindowDelegate @implementation WindowDelegate
- (BOOL)windowShouldClose:(WailsWindow *)sender { - (BOOL)windowShouldClose:(WailsWindow *)sender {
[sender orderOut:nil]; if( self.hideOnClose ) {
if( self.hideOnClose == false ) { [NSApp hide:nil];
processMessage("Q"); return false;
} }
return !self.hideOnClose; processMessage("Q");
return false;
} }
- (void)windowDidExitFullScreen:(NSNotification *)notification { - (void)windowDidExitFullScreen:(NSNotification *)notification {
[self.ctx.mainWindow applyWindowConstraints]; [self.ctx.mainWindow applyWindowConstraints];
} }