mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
BugFix: Display Lock and Unlock Lag
This commit is contained in:
parent
4198a4d68c
commit
bb183a701d
8 changed files with 132 additions and 18 deletions
|
|
@ -35,7 +35,7 @@ final class LockScreenReminderWidgetPanelManager {
|
|||
}
|
||||
|
||||
func refreshPosition(animated: Bool) {
|
||||
guard let window, window.isVisible, let screen = NSScreen.main else { return }
|
||||
guard let window, window.isVisible, let screen = currentScreen() else { return }
|
||||
let target = frame(for: window.frame.size, on: screen)
|
||||
if animated {
|
||||
NSAnimationContext.runAnimationGroup { context in
|
||||
|
|
@ -49,7 +49,7 @@ final class LockScreenReminderWidgetPanelManager {
|
|||
}
|
||||
|
||||
private func render(snapshot: LockScreenReminderWidgetSnapshot, makeVisible: Bool) {
|
||||
guard let screen = NSScreen.main else { return }
|
||||
guard let screen = currentScreen() else { return }
|
||||
if !makeVisible, window == nil {
|
||||
return
|
||||
}
|
||||
|
|
@ -161,5 +161,9 @@ final class LockScreenReminderWidgetPanelManager {
|
|||
refreshPosition(animated: false)
|
||||
print("LockScreenReminderWidgetPanelManager: realigned window due to \(reason)")
|
||||
}
|
||||
|
||||
private func currentScreen() -> NSScreen? {
|
||||
LockScreenDisplayContextProvider.shared.contextSnapshot()?.screen ?? NSScreen.main
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue