From 47fd30c23fce80c662acf1a55d05ca73bdf7fdde Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 22 Dec 2020 20:37:39 +0100 Subject: [PATCH] Ignore NSUserNotificationCenter deprecation --- src/core/mac_startup.mm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/core/mac_startup.mm b/src/core/mac_startup.mm index b88df8170..172786f6a 100644 --- a/src/core/mac_startup.mm +++ b/src/core/mac_startup.mm @@ -216,19 +216,23 @@ QDebug operator<<(QDebug dbg, NSObject* object) { [delegate_ setShortcutHandler:shortcut_handler_]; [self setDelegate:delegate_]; + // FIXME +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" [ [NSUserNotificationCenter defaultUserNotificationCenter]setDelegate:delegate_]; +#pragma GCC diagnostic pop } - (void)sendEvent:(NSEvent*)event { if ([event type] == NSEventTypeSystemDefined && [event subtype] == 8) { - int keyCode = (([event data1] & 0xFFFF0000) >> 16); - int keyFlags = ([event data1] & 0x0000FFFF); - int keyIsReleased = (((keyFlags & 0xFF00) >> 8)) == 0xB; - if (keyIsReleased) { - shortcut_handler_->MacMediaKeyPressed(keyCode); - } + int keyCode = (([event data1] & 0xFFFF0000) >> 16); + int keyFlags = ([event data1] & 0x0000FFFF); + int keyIsReleased = (((keyFlags & 0xFF00) >> 8)) == 0xB; + if (keyIsReleased) { + shortcut_handler_->MacMediaKeyPressed(keyCode); + } } [super sendEvent:event];