Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: settings window display issue #410

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ - (void)showFloatingWindow:(EZBaseQueryWindow *)window atPoint:(CGPoint)point {
[preferencesWindowController.window close];
}

// Workaround for SwiftUI Settings window
// https://github.com/tisfeng/Easydict/issues/362
for (NSWindow *window in [NSApp windows]) {
if ([window.identifier isEqualToString:@"com_apple_SwiftUI_Settings_window"]) {
[window close];
}
}

// get safe window position
CGPoint safeLocation = [EZCoordinateUtils getFrameSafePoint:window.frame moveToPoint:point inScreen:self.screen];
[window setFrameOrigin:safeLocation];
Expand Down Expand Up @@ -904,11 +912,6 @@ - (void)closeFloatingWindow {
self.floatingWindow.titleBar.pin = NO;
[self.floatingWindow close];

if (![EZPreferencesWindowController.shared isShowing]) {
// recover last app.
[self activeLastFrontmostApplication];
}

if ([EZMainQueryWindow isAlive]) {
[self.mainWindow orderBack:nil];
}
Expand Down