Skip to content

Commit

Permalink
Fix switching screens with "pinned" calendar (#145)
Browse files Browse the repository at this point in the history
Focusing another screen with "pinned" calendar would cause it to disappear forever
  • Loading branch information
pakerwreah authored Sep 18, 2023
1 parent b354b30 commit 62dd489
Show file tree
Hide file tree
Showing 2 changed files with 12 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 @@ -1259,7 +1259,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.10.2;
MARKETING_VERSION = 1.10.3;
PRODUCT_BUNDLE_IDENTIFIER = br.paker.Calendr;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Calendr/Config/Calendr-Bridging-Header.h";
Expand All @@ -1285,7 +1285,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.10.2;
MARKETING_VERSION = 1.10.3;
PRODUCT_BUNDLE_IDENTIFIER = br.paker.Calendr;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Calendr/Config/Calendr-Bridging-Header.h";
Expand Down
10 changes: 10 additions & 0 deletions Calendr/Main/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,16 @@ class MainViewController: NSViewController, NSPopoverDelegate {
searchInputText
.bind(to: searchInput.rx.stringValue)
.disposed(by: disposeBag)

// 🔨 Dirty hack to force the window to update its position
// when switching screens with pinned (sticky) calendar
screenProvider.screenObservable
.bind { [weak self] _ in
guard let self, let window = self.view.window else { return }
window.setContentSize(.zero)
window.setContentSize(self.contentSize)
}
.disposed(by: disposeBag)
}

private func setUpSettings() {
Expand Down

0 comments on commit 62dd489

Please sign in to comment.