mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
app/internal/window: [macOS] only terminate app when last window closes
Updates #19 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -50,8 +50,7 @@
|
||||
- (void)windowWillClose:(NSNotification *)notification {
|
||||
NSWindow *window = (NSWindow *)[notification object];
|
||||
window.delegate = nil;
|
||||
gio_onTerminate((__bridge CFTypeRef)window.contentView);
|
||||
[NSApp terminate:nil];
|
||||
gio_onClose((__bridge CFTypeRef)window.contentView);
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -151,6 +150,12 @@ void gio_makeKeyAndOrderFront(CFTypeRef viewRef) {
|
||||
[view.window makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
void gio_appTerminate(void) {
|
||||
@autoreleasepool {
|
||||
[NSApp terminate:nil];
|
||||
}
|
||||
}
|
||||
|
||||
void gio_main(CFTypeRef viewRef, const char *title, CGFloat width, CGFloat height) {
|
||||
@autoreleasepool {
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
Reference in New Issue
Block a user