5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 07:40:17 +08:00

[v2/Mac] Handle application terminate (#3157)

* [v2/Mac] Handle application terminate

* add change log

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
ALMAS 2024-01-08 05:08:04 +08:00 committed by GitHub
parent f7c19469a7
commit bf389e3914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "AppDelegate.h" #import "AppDelegate.h"
#import "message.h"
@implementation AppDelegate @implementation AppDelegate
-(BOOL)application:(NSApplication *)sender openFile:(NSString *)filename -(BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
@ -22,6 +23,11 @@
return NO; return NO;
} }
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
processMessage("Q");
return NSTerminateCancel;
}
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification { - (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
if (self.alwaysOnTop) { if (self.alwaysOnTop) {

View File

@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add Apple Silicon hardware detection to `wails doctor`. Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3129) - Add Apple Silicon hardware detection to `wails doctor`. Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3129)
- Remove quarantine attribute on macOS binaries. Changed by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/3118) - Remove quarantine attribute on macOS binaries. Changed by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/3118)
- Added documentation for a common GStreamer error on Linux systems. Changed by [@mkwsnyder](https://github.com/mkwsnyder) in [PR](https://github.com/wailsapp/wails/pull/3134) - Added documentation for a common GStreamer error on Linux systems. Changed by [@mkwsnyder](https://github.com/mkwsnyder) in [PR](https://github.com/wailsapp/wails/pull/3134)
- Add dock icon right-click exit handling by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3157)
### Fixed ### Fixed
- Docs for IsZoomControlEnabled and ZoomFactor. Fixed by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/3137) - Docs for IsZoomControlEnabled and ZoomFactor. Fixed by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/3137)