From 889f2fce6d9bde3c8481ebf888c8bb4d8c0cbaf0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 20 Nov 2021 06:08:30 +0530 Subject: [PATCH] Avoid deprecation warning from Apple Apparently Apple invent half-assed language extensions like @available and then dont implement them properly --- kitty/cocoa_window.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/cocoa_window.m b/kitty/cocoa_window.m index 80744d3d2..25377c153 100644 --- a/kitty/cocoa_window.m +++ b/kitty/cocoa_window.m @@ -230,8 +230,8 @@ cocoa_send_notification(PyObject *self UNUSED, PyObject *args) { willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { UNNotificationPresentationOptions options = UNNotificationPresentationOptionSound; - if(@available(macOS 11.0, *)) options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner; - else options |= UNNotificationPresentationOptionAlert; + if (@available(macOS 11.0, *)) options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner; + else options |= (1 << 2); // UNNotificationPresentationOptionAlert avoid deprecated warning completionHandler(options); }