[vlc-commits] macosx: Remove VLCColor view, draw video view in black

David Fuhrmann git at videolan.org
Sun Sep 3 17:07:23 CEST 2017


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Sep  3 15:18:18 2017 +0200| [034259aab30e0025b8f3e6f4c12d64d16c9565bb] | committer: David Fuhrmann

macosx: Remove VLCColor view, draw video view in black

Video view is drawn black in case first frame is not shown
instantly. NSWindow background color cannot be used anymore, as
it draws the title bar in a grey tone as well, which is not
desired.

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

 modules/gui/macosx/VLCMainWindow.m          | 18 ------------------
 modules/gui/macosx/VLCMainWindowTitleView.h |  4 ----
 modules/gui/macosx/VLCMainWindowTitleView.m | 16 ----------------
 modules/gui/macosx/VLCVoutView.m            |  7 +++++++
 4 files changed, 7 insertions(+), 38 deletions(-)

diff --git a/modules/gui/macosx/VLCMainWindow.m b/modules/gui/macosx/VLCMainWindow.m
index 6f469dcd28..c0d7b59ddb 100644
--- a/modules/gui/macosx/VLCMainWindow.m
+++ b/modules/gui/macosx/VLCMainWindow.m
@@ -71,8 +71,6 @@
 
     BOOL b_podcastView_displayed;
 
-    VLCColorView * o_color_backdrop;
-
     NSRect frameBeforePlayback;
 }
 - (void)makeSplitViewVisible;
@@ -250,10 +248,6 @@ static const float f_min_window_height = 307.;
         [self setHasShadow:YES];
 
         self.previousSavedFrame = [self frame];
-
-        o_color_backdrop = [[VLCColorView alloc] initWithFrame:_splitView.frame];
-        [[self contentView] addSubview:o_color_backdrop positioned:NSWindowBelow relativeTo:_splitView];
-        [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
     } else {
         [_playlistScrollView setBorderType:NSNoBorder];
         [_sidebarScrollView setBorderType:NSNoBorder];
@@ -1256,9 +1250,6 @@ static const float f_min_window_height = 307.;
 @end
 
 @interface VLCDetachedVideoWindow ()
-{
-    VLCColorView * o_color_backdrop;
-}
 @end
 
 @implementation VLCDetachedVideoWindow
@@ -1281,15 +1272,6 @@ static const float f_min_window_height = 307.;
 
         [self setTitle: _NS("VLC media player")];
 
-    } else {
-        [self setBackgroundColor: [NSColor blackColor]];
-    }
-
-    if (darkInterface) {
-        o_color_backdrop = [[VLCColorView alloc] initWithFrame: [self.videoView frame]];
-        [[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: self.videoView];
-        [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
-
         [self setContentMinSize: NSMakeSize(363., f_min_video_height + [[self controlsBar] height] + [self.titlebarView frame].size.height)];
     } else {
         [self setContentMinSize: NSMakeSize(363., f_min_video_height + [[self controlsBar] height])];
diff --git a/modules/gui/macosx/VLCMainWindowTitleView.h b/modules/gui/macosx/VLCMainWindowTitleView.h
index 4920b78d59..8a3d0efe0f 100644
--- a/modules/gui/macosx/VLCMainWindowTitleView.h
+++ b/modules/gui/macosx/VLCMainWindowTitleView.h
@@ -59,10 +59,6 @@
 
 @end
 
- at interface VLCColorView : NSView
-
- at end
-
 @interface VLCCustomWindowButtonPrototype : NSButton
 
 - (NSArray*)extendedAccessibilityAttributeNames: (NSArray*)theAttributeNames;
diff --git a/modules/gui/macosx/VLCMainWindowTitleView.m b/modules/gui/macosx/VLCMainWindowTitleView.m
index a30d81c6ec..73e2bb960a 100644
--- a/modules/gui/macosx/VLCMainWindowTitleView.m
+++ b/modules/gui/macosx/VLCMainWindowTitleView.m
@@ -365,22 +365,6 @@
 
 
 /*****************************************************************************
- * VLCColorView
- *
- * since we are using a clear window color when using the black window
- * style, some filling is needed behind the video and some other elements
- *****************************************************************************/
-
- at implementation VLCColorView
-
-- (void)drawRect:(NSRect)rect {
-    [[NSColor blackColor] setFill];
-    NSRectFill(rect);
-}
-
- at end
-
-/*****************************************************************************
  * custom window buttons to support the accessibility stuff
  *****************************************************************************/
 
diff --git a/modules/gui/macosx/VLCVoutView.m b/modules/gui/macosx/VLCVoutView.m
index 505402801b..4952afe18b 100644
--- a/modules/gui/macosx/VLCVoutView.m
+++ b/modules/gui/macosx/VLCVoutView.m
@@ -84,6 +84,13 @@
     return self;
 }
 
+- (void)drawRect:(NSRect)rect
+{
+    // Draw black area in case first frame is not drawn yet
+    [[NSColor blackColor] setFill];
+    NSRectFill(rect);
+}
+
 - (void)addVoutLayer:(CALayer *)aLayer
 {
     if (self.layer == nil) {



More information about the vlc-commits mailing list