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

Fix acknow window #779

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

Fix acknow window #779

wants to merge 3 commits into from

Conversation

tisfeng
Copy link
Owner

@tisfeng tisfeng commented Jan 6, 2025

Comment on lines +79 to 95
// Acknowledgements window for macOS 15+
// Can't use else direct here since SceneBuilder does not implement it yet.
// Fix issue "Closure containing control flow statement cannot be used with result builder 'SceneBuilder'"
if #available(macOS 15.0, *) {
// Acknowledgements window
Window("setting.about.acknowledgements", id: .acknowledgementsWindowIdMacOS15Plus) {
AcknowListView()
}
.windowToolbarStyle(.unifiedCompact)
.defaultSize(width: 800, height: 600)
.restorationBehavior(.disabled)
}

// Acknowledgements window for macOS 15-, cannot use #unavailable
Window("setting.about.acknowledgements", id: .acknowledgementsWindowId) {
AcknowListView()
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not good. I tried to improve it, but didn't succeed. I know this is to pass the compilation. This is a problem with SwiftUI.

It seems we have no way to control a view to only display on macOS 15 or below, which will cause both Acknowledgements windows to be executed, including AcknowListView.

rm -rf ~/Library/Saved\ Application\ State/com.izual.Easydict.savedState

If this solution works, I suggest we do not add this code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we request the original issue creator to try the solution first. The window should not be saved in most cases. (That's explained why you and I both can't reproduce it.)

@tisfeng tisfeng marked this pull request as draft January 6, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants