From 4e6183da19b9c22bf0d0729493a1c3118266a484 Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Fri, 7 Dec 2018 02:13:19 +0200 Subject: [PATCH] Disable custom scroll on 10.13 to prevent a crash --- .../DetoxInstruments/Views/DTXScrollView.m | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/DetoxInstruments/DetoxInstruments/Views/DTXScrollView.m b/DetoxInstruments/DetoxInstruments/Views/DTXScrollView.m index 76237af4..18764474 100644 --- a/DetoxInstruments/DetoxInstruments/Views/DTXScrollView.m +++ b/DetoxInstruments/DetoxInstruments/Views/DTXScrollView.m @@ -156,16 +156,19 @@ - (void)awakeFromNib self.wantsLayer = YES; self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay; - - _requiresCustomHorizontalScrollerManagement = YES; - - _horizontalScroller = [DTXScroller new]; - _horizontalScroller.enabled = YES; - _horizontalScroller.alphaValue = 0.0; - [_horizontalScroller _setIsHorizontal:YES]; - [_horizontalScroller setOverlayScrollerTrackAlpha:0.0]; - _horizontalScroller.scrollerStyle = [NSScroller preferredScrollerStyle]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_scrollerStyleDidChange_DTX) name:NSPreferredScrollerStyleDidChangeNotification object:nil]; + + if(NSProcessInfo.processInfo.operatingSystemVersion.minorVersion >= 14) + { + _requiresCustomHorizontalScrollerManagement = YES; + + _horizontalScroller = [DTXScroller new]; + _horizontalScroller.enabled = YES; + _horizontalScroller.alphaValue = 0.0; + [_horizontalScroller _setIsHorizontal:YES]; + [_horizontalScroller setOverlayScrollerTrackAlpha:0.0]; + _horizontalScroller.scrollerStyle = [NSScroller preferredScrollerStyle]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_scrollerStyleDidChange_DTX) name:NSPreferredScrollerStyleDidChangeNotification object:nil]; + } self.horizontalScroller.alphaValue = 0.0;