Skip to content

Commit

Permalink
perf: do not deallock main window when clicking close button (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng authored Mar 10, 2024
1 parent 3dff50f commit 30aeeb6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Easydict/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ - (void)applicationWillTerminate:(NSNotification *)aNotification {
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)application {
[EZWindowManager.shared closeMainWindowIfNeeded];

return NO;
}

- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {
// Fix https://github.com/tisfeng/Easydict/issues/447
[EZWindowManager.shared showMainWindowIfNedded];

return YES;
}

@end

0 comments on commit 30aeeb6

Please sign in to comment.