Skip to content

Commit 8a36e70

Browse files
committed
fix: do not set main window postion to center every time when reopening it
1 parent 540a35e commit 8a36e70

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,15 @@ - (void)showMainWindowIfNeeded {
667667
[NSApp setActivationPolicy:activationPolicy];
668668

669669
if (showFlag) {
670+
// If the main window does not exist, create it first, and show it center.
671+
if (!_mainWindow) {
672+
[self.mainWindow center];
673+
}
674+
[self.mainWindow makeKeyAndOrderFront:nil];
670675
[self.floatingWindowTypeArray insertObject:@(EZWindowTypeMain) atIndex:0];
671676

672-
[self.mainWindow center];
673-
[self.mainWindow makeKeyAndOrderFront:nil];
677+
// TODO: We should record main window showing position, like mini window.
678+
// [self showFloatingWindowType:EZWindowTypeMain queryText:nil];
674679
}
675680
}
676681

0 commit comments

Comments
 (0)