[vlc-commits] add black view to detached video window in order to avoid transparent or grey flashes

David Fuhrmann git at videolan.org
Sat Oct 6 17:30:12 CEST 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sat Oct  6 17:29:20 2012 +0200| [c2b7fa23e2c3c6c5c8303ac262b59654ccfe70a0] | committer: David Fuhrmann

add black view to detached video window in order to avoid transparent or grey flashes

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

 modules/gui/macosx/MainWindow.h |    2 ++
 modules/gui/macosx/MainWindow.m |   16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index c02da14..9abef4f 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -135,6 +135,8 @@
     NSTimer *t_hide_mouse_timer;
 
     VLCColorView * o_color_backdrop;
+    VLCColorView * o_detached_color_backdrop;
+
     NSInteger i_originalLevel;
     NSRect previousSavedFrame;
 }
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 716b6e7..1937823 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -147,7 +147,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
 - (void)dealloc
 {
     if (b_dark_interface)
+    {
         [o_color_backdrop release];
+        [o_detached_color_backdrop release];
+    }
 
     [[NSNotificationCenter defaultCenter] removeObserver: self];
     [o_sidebaritems release];
@@ -565,6 +568,15 @@ static VLCMainWindow *_o_sharedInstance = nil;
         o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view frame]];
         [[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: o_split_view];
         [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
+
+        NSRect backdropFrame = [[o_detached_video_window contentView] bounds];
+        backdropFrame.origin.y = [o_detached_bottombar_view frame].size.height;
+        backdropFrame.size.height -= [o_detached_bottombar_view frame].size.height;
+        backdropFrame.size.height -= [o_detached_titlebar_view frame].size.height;
+
+        o_detached_color_backdrop = [[VLCColorView alloc] initWithFrame: backdropFrame];
+        [[o_detached_video_window contentView] addSubview: o_detached_color_backdrop positioned: NSWindowBelow relativeTo: nil];
+        [o_detached_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
     }
     else
     {
@@ -2686,6 +2698,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [self setHasShadow:NO];
         [self setHasShadow:YES];
     }
+    else
+    {
+        [self setBackgroundColor: [NSColor blackColor]];
+    }
 }
 
 - (IBAction)fullscreen:(id)sender



More information about the vlc-commits mailing list