From: Marvin Scholz Date: Wed, 21 Jun 2017 00:09:40 +0000 (+0200) Subject: macOS: Don't draw custom VLCHUDCheckboxCell on 10.10+ X-Git-Tag: 3.0.0-git~2544 X-Git-Url: http://git.videolan.org/?p=vlc.git;a=commitdiff_plain;h=d6caef37cd2d337baac599733a9936b5435240e7;ds=sidebyside macOS: Don't draw custom VLCHUDCheckboxCell on 10.10+ --- diff --git a/modules/gui/macosx/VLCHUDCheckboxCell.m b/modules/gui/macosx/VLCHUDCheckboxCell.m index 93df527d3a..b9e8c93827 100644 --- a/modules/gui/macosx/VLCHUDCheckboxCell.m +++ b/modules/gui/macosx/VLCHUDCheckboxCell.m @@ -33,9 +33,26 @@ // POSSIBILITY OF SUCH DAMAGE. #import "VLCHUDCheckboxCell.h" +#import "CompatibilityFixes.h" @implementation VLCHUDCheckboxCell ++ (void)load +{ + /* On 10.10+ we do not want custom drawing, therefore we swap out the implementation + * of the selectors below with their original implementations. + * Just calling super will not work, as the AppKit implementation for the NSButton + * checkbox checks if the drawing related selectors below are overriden, and if + * that is the case, will fall back to legacy drawing, without animation, + * without vibrancy and non-layer-based. + */ + if (OSX_YOSEMITE_AND_HIGHER) { + swapoutOverride([VLCHUDCheckboxCell class], @selector(initWithCoder:)); + swapoutOverride([VLCHUDCheckboxCell class], @selector(drawImage:withFrame:inView:)); + swapoutOverride([VLCHUDCheckboxCell class], @selector(drawTitle:withFrame:inView:)); + } +} + - (instancetype)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder];