mirror of
https://github.com/ollama/ollama.git
synced 2026-09-21 05:28:00 -05:00
app: keep closed macOS windows from reopening on activation (#18518)
This commit is contained in:
@@ -595,7 +595,7 @@ static NSImage *ollamaApplicationIcon(void) {
|
||||
[fileMenu addItem:newChatItem];
|
||||
[fileMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
NSMenuItem *closeItem = [[NSMenuItem alloc] initWithTitle:@"Close Window" action:@selector(hide:) keyEquivalent:@"w"];
|
||||
NSMenuItem *closeItem = [[NSMenuItem alloc] initWithTitle:@"Close Window" action:@selector(performClose:) keyEquivalent:@"w"];
|
||||
[fileMenu addItem:closeItem];
|
||||
[fileMenuItem setSubmenu:fileMenu];
|
||||
[mainMenu addItem:fileMenuItem];
|
||||
@@ -1486,7 +1486,8 @@ didCompleteWithError:(NSError *)error {
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(id)sender {
|
||||
[NSApp hide:nil];
|
||||
// Keep the webview alive without restoring the window on app activation.
|
||||
[sender orderOut:nil];
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user