Skip to content

Commit

Permalink
perf: do not deallock main window when clicking close button
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Mar 9, 2024
1 parent 1c9c88f commit b2fc3c5
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 b2fc3c5

Please sign in to comment.