mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 16:28:19 +02:00
Add *some* closed events to cocoa notifications
This commit is contained in:
@@ -421,18 +421,20 @@ class MacOSIntegration(DesktopIntegration):
|
||||
cocoa_send_notification(str(desktop_notification_id), title, body or ' ', subtitle, urgency.value)
|
||||
return desktop_notification_id
|
||||
|
||||
def notification_activated(self, ident: str, activated: bool) -> None:
|
||||
def notification_activated(self, event: str, ident: str) -> None:
|
||||
if debug_desktop_integration:
|
||||
log_error(f'Notification {ident} {activated=}')
|
||||
log_error(f'Notification {ident} {event=}')
|
||||
try:
|
||||
desktop_notification_id = int(ident)
|
||||
except Exception:
|
||||
log_error(f'Got unexpected notification activated event with id: {ident!r} from cocoa')
|
||||
else:
|
||||
if activated:
|
||||
self.notification_manager.notification_activated(desktop_notification_id)
|
||||
else:
|
||||
self.notification_manager.notification_closed(desktop_notification_id)
|
||||
return
|
||||
if event == "created":
|
||||
self.notification_manager.notification_created(desktop_notification_id)
|
||||
elif event == "activated":
|
||||
self.notification_manager.notification_activated(desktop_notification_id)
|
||||
elif event == "closed":
|
||||
self.notification_manager.notification_closed(desktop_notification_id)
|
||||
|
||||
|
||||
class FreeDesktopIntegration(DesktopIntegration):
|
||||
|
||||
Reference in New Issue
Block a user