[vlc-commits] macosx: FSPanelController: Remove unnecessary injectBackgroundView

Marvin Scholz git at videolan.org
Sun Feb 18 16:11:01 CET 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sun Feb 18 15:57:59 2018 +0100| [66648e9afe102399bfd3a5314d26ff955e2b33e0] | committer: Marvin Scholz

macosx: FSPanelController: Remove unnecessary injectBackgroundView

On 10.10 and higher we always use the NSVisualEffectView, so this
is completely dead code for 4.0

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=66648e9afe102399bfd3a5314d26ff955e2b33e0
---

 modules/gui/macosx/VLCFSPanelController.m | 36 +------------------------------
 1 file changed, 1 insertion(+), 35 deletions(-)

diff --git a/modules/gui/macosx/VLCFSPanelController.m b/modules/gui/macosx/VLCFSPanelController.m
index 7136aef001..cd9957e233 100644
--- a/modules/gui/macosx/VLCFSPanelController.m
+++ b/modules/gui/macosx/VLCFSPanelController.m
@@ -81,11 +81,7 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
     [self.window setFrameAutosaveName:@"VLCFullscreenControls"];
 
     /* Inject correct background view depending on OS support */
-    if (OSX_YOSEMITE_AND_HIGHER) {
-        [self injectVisualEffectView];
-    } else {
-        [self injectBackgroundView];
-    }
+    [self injectVisualEffectView];
 
     [self setupControls];
 }
@@ -459,7 +455,6 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
  This is necessary as we can't use the NSVisualEffect view on
  all macOS Versions and therefore need to dynamically insert it.
 
- \warning Never call both, \c injectVisualEffectView and \c injectBackgroundView
  */
 - (void)injectVisualEffectView
 {
@@ -478,35 +473,6 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
 }
 #pragma clang diagnostic pop
 
-/**
- Injects the standard background view in the Windows view hierarchy
-
- This is necessary on macOS versions that do not support the
- NSVisualEffectView that usually is injected.
-
- \warning Never call both, \c injectVisualEffectView and \c injectBackgroundView
- */
-- (void)injectBackgroundView
-{
-    /* Setup the view */
-    CGColorRef color = CGColorCreateGenericGray(0.0, 0.8);
-    NSView *view = [[NSView alloc] initWithFrame:self.window.contentView.frame];
-    [view setWantsLayer:YES];
-    [view.layer setBackgroundColor:color];
-    [view.layer setCornerRadius:8.0];
-    [view setAutoresizesSubviews:YES];
-    CGColorRelease(color);
-
-    /* Inject view in view hierarchy */
-    [self.window setContentView:view];
-    [self.window.contentView addSubview:_controlsView];
-
-    /* Disable adjusting height to workaround autolayout problems */
-    [_heightMaxConstraint setConstant:42.0];
-    [self.window setMaxSize:NSMakeSize(4068, 80)];
-    [self.window setMinSize:NSMakeSize(480, 80)];
-}
-
 - (void)dealloc
 {
     [self stopAutohideTimer];



More information about the vlc-commits mailing list