Commit b4731197 authored by David Fuhrmann's avatar David Fuhrmann

osx_notification: Enable default macOS min version, fix compilation

Remove fixed macosx-min-version, as the min version is already
set globally. Fix compilation by ignoring the partial availability
warning. Code is written in a way that it gets disabled on 10.7,
where Growl is still used.
parent 087ebf98
notifydir = $(pluginsdir)/notify
libosx_notifications_plugin_la_SOURCES = notify/osx_notifications.m
libosx_notifications_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_osx_notifications) -mmacosx-version-min=10.8
libosx_notifications_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_osx_notifications)
libosx_notifications_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(notifydir)' -Wl,-framework,AppKit
libosx_notifications_plugin_la_LIBADD = $(LIBS_osx_notifications)
libosx_notifications_plugin_la_LIBTOOLFLAGS = --tag=CC
libnotify_plugin_la_SOURCES = notify/notify.c
libnotify_plugin_la_CFLAGS = $(AM_CFLAGS) $(NOTIFY_CFLAGS)
......
......@@ -272,6 +272,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
- (void)dealloc
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// Clear the remaining lastNotification in Notification Center, if any
@autoreleasepool {
......@@ -283,6 +285,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
#endif
#pragma clang diagnostic pop
// Release everything
[applicationName release];
......@@ -306,12 +309,15 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[GrowlApplicationBridge setGrowlDelegate:self];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
if (hasNativeNotifications) {
[[NSUserNotificationCenter defaultUserNotificationCenter]
setDelegate:(id<NSUserNotificationCenterDelegate>)self];
}
#endif
#pragma clang diagnostic pop
}
}
......@@ -375,6 +381,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
clickContext:nil
identifier:@"VLCNowPlayingNotification"];
} else if (hasNativeNotifications) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// Make the OS X notification and string
NSUserNotification *notification = [NSUserNotification new];
......@@ -398,6 +406,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
[notification release];
#endif
#pragma clang diagnostic pop
}
// Release stuff
......@@ -425,6 +434,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
isInForeground = NO;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
- (void)userNotificationCenter:(NSUserNotificationCenter *)center
didActivateNotification:(NSUserNotification *)notification
......@@ -447,4 +458,5 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
lastNotification = notification;
}
#endif
#pragma clang diagnostic pop
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment