Skip to content

Commit

Permalink
fix: settings window display issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phlpsong committed Feb 16, 2024
1 parent 1c228a8 commit 51b5792
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit 51b5792

Please sign in to comment.