Distributed Notifications

This commit is contained in:
Hariharan Mudaliar 2026-03-20 19:54:22 +05:30
commit a2d18cda49
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
2 changed files with 40 additions and 0 deletions

View file

@ -156,6 +156,16 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
func applicationWillTerminate(_ notification: Notification) {
let userInfo: [String: Any] = [
AtollDistributedNotifications.UserInfoKey.sourcePID: NSNumber(value: ProcessInfo.processInfo.processIdentifier)
]
DistributedNotificationCenter.default().postNotificationName(
AtollDistributedNotifications.didBecomeIdle,
object: nil,
userInfo: userInfo,
deliverImmediately: true
)
// Cancel any pending window size updates
windowSizeUpdateWorkItem?.cancel()
NotificationCenter.default.removeObserver(self)
@ -393,6 +403,16 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
func applicationDidFinishLaunching(_ notification: Notification) {
let userInfo: [String: Any] = [
AtollDistributedNotifications.UserInfoKey.sourcePID: NSNumber(value: ProcessInfo.processInfo.processIdentifier)
]
DistributedNotificationCenter.default().postNotificationName(
AtollDistributedNotifications.didBecomeActive,
object: nil,
userInfo: userInfo,
deliverImmediately: true
)
LockScreenLiveActivityWindowManager.shared.configure(viewModel: vm)
LockScreenManager.shared.configure(viewModel: vm)
extensionXPCServiceHost.start()