[vlc-commits] macosx: make sure the main window's position is correctly restored ( fixes #5856)

Felix Paul Kühne git at videolan.org
Wed Jan 25 00:01:33 CET 2012


vlc/vlc-1.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jan 24 20:03:32 2012 +0100| [3948a4b69a695b3c8fa913314de19706c676042e] | committer: Jean-Baptiste Kempf

macosx: make sure the main window's position is correctly restored (fixes #5856)
(cherry picked from commit d832507736d33cb435ba1830e9bdbace89a68c2e)

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

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

 modules/gui/macosx/MainWindow.m |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 80cc50b..6875bd9 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -411,16 +411,15 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [self setOpaque: NO];
         [self setHasShadow:YES];
 
-        NSRect winrect;
+        NSRect winrect = [self frame];
         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];
+        [self setFrame: winrect display:YES animate:YES];
+        previousSavedFrame = winrect;
         winrect = [o_split_view frame];
         winrect.size.height = winrect.size.height - f_titleBarHeight;
         [o_split_view setFrame: winrect];
@@ -429,10 +428,6 @@ 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];
-
-        previousSavedFrame = winrect;
-
-        [self display];
     }
     else
     {
@@ -891,6 +886,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (void)windowResizedOrMoved:(NSNotification *)notification
 {
+    previousSavedFrame = [self frame];
     [self saveFrameUsingName: [self frameAutosaveName]];
 }
 



More information about the vlc-commits mailing list