diff --git a/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m b/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m index 65e6d21cd..f1bae5f29 100644 --- a/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m +++ b/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m @@ -667,10 +667,15 @@ - (void)showMainWindowIfNeeded { [NSApp setActivationPolicy:activationPolicy]; if (showFlag) { + // If the main window does not exist, create it first, and show it center. + if (!_mainWindow) { + [self.mainWindow center]; + } + [self.mainWindow makeKeyAndOrderFront:nil]; [self.floatingWindowTypeArray insertObject:@(EZWindowTypeMain) atIndex:0]; - [self.mainWindow center]; - [self.mainWindow makeKeyAndOrderFront:nil]; + // TODO: We should record main window showing position, like mini window. +// [self showFloatingWindowType:EZWindowTypeMain queryText:nil]; } }