Skip to content

Commit

Permalink
[v2/Mac] Handle application terminate
Browse files Browse the repository at this point in the history
  • Loading branch information
almas1992 authored Dec 26, 2023
1 parent 3c7a218 commit 991422a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions v2/internal/frontend/desktop/darwin/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import <Cocoa/Cocoa.h>

#import "AppDelegate.h"
#import "message.h"

@implementation AppDelegate
-(BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
Expand All @@ -22,6 +23,11 @@ - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
return NO;
}

- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
processMessage("Q");
return NSTerminateCancel;
}

- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
if (self.alwaysOnTop) {
Expand Down

0 comments on commit 991422a

Please sign in to comment.