electron-archive/brightray

Notification icon is ignored on OS X 10.9 and lower

miniak opened this issue · 6 comments

notification_presenter_mac.mm:

  if (base::mac::IsOSYosemiteOrLater() && !icon.drawsNothing())
    notification.contentImage = gfx::SkBitmapToNSImageWithColorSpace(icon, base::mac::GetGenericRGBColorSpace());

What is the reason for ignoring the icon on older versions of OS X?

Older versions of OS X don't support contentImage at all

I would rewrite it like this:

    if ([notification respondsToSelector:@selector(setContentImage:)] && !icon.drawsNothing())
        notification.contentImage = gfx::SkBitmapToNSImageWithColorSpace(icon, base::mac::GetGenericRGBColorSpace());

Oops, off by one! Should be IsOSMavericksOrLater

Fixed by #171.