]> git.sesse.net Git - vlc/commitdiff
macosx: add black view to detached video view in order to avoid flashes
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 6 Oct 2012 14:49:04 +0000 (16:49 +0200)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 6 Oct 2012 14:49:40 +0000 (16:49 +0200)
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.m

index c4ff256bc8a9121fb7a7ed6e4bd3a16ec982e5cf..c332fec28cc82a47433d07694f6b334e581700ec 100644 (file)
 @end
 
 @interface VLCDetachedVideoWindow : VLCVideoWindowCommon
+{
+    VLCColorView * o_color_backdrop;
+}
 
 @end
\ No newline at end of file
index 24a7495d4fcf2eefd5ece875ce21771a31145607..6f3c75e376172fc006a36e67a1e6893464850518 100644 (file)
@@ -1762,8 +1762,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
 {
     [self setAcceptsMouseMovedEvents: YES];
 
-    [self setBackgroundColor: [NSColor blackColor]];
     if (b_dark_interface) {
+        [self setBackgroundColor: [NSColor clearColor]];
+
         [self setOpaque: NO];
         [self display];
         [self setHasShadow:NO];
@@ -1778,6 +1779,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
         // native fs not supported with detached view yet
         [o_titlebar_view setFullscreenButtonHidden: YES];
+    } else {
+        [self setBackgroundColor: [NSColor blackColor]];
     }
 
     NSRect videoViewRect = [[self contentView] bounds];
@@ -1789,10 +1792,22 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [o_video_view setFrame: videoViewRect];
 
     if (b_dark_interface) {
+        o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_video_view frame]];
+        [[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: o_video_view];
+        [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
+
         [self setContentMinSize: NSMakeSize(363., f_min_video_height + [[[self controlsBar] bottomBarView] frame].size.height + [o_titlebar_view frame].size.height)];
     } else {
         [self setContentMinSize: NSMakeSize(363., f_min_video_height + [[[self controlsBar] bottomBarView] frame].size.height)];
     }
 }
 
+- (void)dealloc
+{
+    if (b_dark_interface)
+        [o_color_backdrop release];
+
+    [super dealloc];
+}
+
 @end