Skip to content

Commit 0a393fc

Browse files
committed
Fix crash on Sequoia
1 parent cafa500 commit 0a393fc

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Maccy/MaccyApp.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,17 @@ struct MaccyApp: App {
3939
var body: some Scene {
4040
MenuBarExtra(isInserted: $showMenuIcon) {
4141
EmptyView()
42+
.introspectMenuBarExtraWindow { window in
43+
window.hasShadow = false
44+
window.level = .normal
45+
}
4246
} label: {
4347
if showRecentCopyInMenuBar {
4448
Text(appState.menuIconText)
4549
}
4650
Image(nsImage: menuIcon.image)
4751
}
52+
.menuBarExtraStyle(.window) // required on Sequoia
4853
.menuBarExtraAccess(isPresented: $appState.popup.menuPresented) { statusItem in
4954
self.statusItem = statusItem
5055
statusItem.button?.appearsDisabled = menuIconAppearsDisable

Maccy/Observables/History.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ class History {
9898

9999
Task {
100100
for await _ in Defaults.updates(.imageMaxHeight, initial: false) {
101-
items.forEach { item in
102-
item.sizeImages()
101+
for item in items {
102+
await item.sizeImages()
103103
}
104104
}
105105
}

Maccy/Observables/HistoryItemDecorator.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ class HistoryItemDecorator: Identifiable, Hashable {
7171
self.title = item.title
7272

7373
Task {
74-
sizeImages()
74+
await sizeImages()
7575
}
7676
}
7777

78+
@MainActor
7879
func sizeImages() {
7980
guard let image = item.image else {
8081
return

0 commit comments

Comments
 (0)