[vlc-commits] macosx: hide the mainwindow's black title bar when using Lion' s fullscreen mode

Felix Paul Kühne git at videolan.org
Fri Dec 23 21:17:43 CET 2011


vlc/vlc-1.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Dec 23 19:58:26 2011 +0100| [6f938b5cd23933bf19048ca02476a0c42ec2c1fc] | committer: Jean-Baptiste Kempf

macosx: hide the mainwindow's black title bar when using Lion's fullscreen mode
(cherry picked from commit cca37149f6f7905a4c1263b6eed51f037455f0a0)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=6f938b5cd23933bf19048ca02476a0c42ec2c1fc
---

 modules/gui/macosx/MainWindow.m |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 2c2fd29..68d3635 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1492,6 +1492,21 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [NSCursor setHiddenUntilMouseMoves: YES];
     b_fullscreen = YES;
     [o_fspanel setVoutWasUpdated: (int)[[self screen] displayID]];
+
+    if (b_dark_interface)
+    {
+        [o_titlebar_view removeFromSuperviewWithoutNeedingDisplay];
+
+        NSRect winrect;
+        CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
+        winrect = [self frame];
+
+        winrect.size.height = winrect.size.height - f_titleBarHeight;
+        [self setFrame: winrect display:NO animate:NO];
+        winrect = [o_split_view frame];
+        winrect.size.height = winrect.size.height + f_titleBarHeight;
+        [o_split_view setFrame: winrect];
+    }
 }
 
 - (void)windowWillExitFullScreen:(NSNotification *)notification
@@ -1500,6 +1515,24 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [NSCursor setHiddenUntilMouseMoves: NO];
     [o_fspanel setNonActive: nil];
     b_fullscreen = NO;
+
+    if (b_dark_interface)
+    {
+        NSRect winrect;
+        CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
+        winrect = [self frame];
+        
+        [o_titlebar_view setFrame: NSMakeRect( 0, winrect.size.height - f_titleBarHeight,
+                                              winrect.size.width, f_titleBarHeight )];
+        [[self contentView] addSubview: o_titlebar_view];
+        
+        winrect.size.height = winrect.size.height + f_titleBarHeight;
+        [self setFrame: winrect display:NO animate:NO];
+        winrect = [o_split_view frame];
+        winrect.size.height = winrect.size.height - f_titleBarHeight;
+        [o_split_view setFrame: winrect];
+        [o_video_view setFrame: winrect];
+    }
 }
 
 #pragma mark -



More information about the vlc-commits mailing list