Skip to content

Commit

Permalink
Make sure popover closeAll is called on the main thread (#337)
Browse files Browse the repository at this point in the history
Fixes #336
  • Loading branch information
pakerwreah authored Jan 3, 2025
1 parent 4995b5b commit dac36b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Calendr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.15.1;
MARKETING_VERSION = 1.15.2;
PRODUCT_BUNDLE_IDENTIFIER = br.paker.Calendr;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Calendr/Config/Calendr-Bridging-Header.h";
Expand Down Expand Up @@ -1535,7 +1535,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.15.1;
MARKETING_VERSION = 1.15.2;
PRODUCT_BUNDLE_IDENTIFIER = br.paker.Calendr;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Calendr/Config/Calendr-Bridging-Header.h";
Expand Down
4 changes: 4 additions & 0 deletions Calendr/Components/Popover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class Popover: NSObject, PopoverWindowDelegate {
}

static func closeAll() {
guard Thread.isMainThread else {
DispatchQueue.main.sync { closeAll() }
return
}
for popover in popovers {
popover.window?.performClose(nil)
}
Expand Down

0 comments on commit dac36b5

Please sign in to comment.