[vlc-commits] macosx: save idle main window frame as early as possible (refs #8826)

David Fuhrmann git at videolan.org
Thu Jun 20 21:53:07 CEST 2013


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Thu Jun 20 21:15:56 2013 +0200| [e6de5c7af302b86713582971816f3639c4a4de75] | committer: David Fuhrmann

macosx: save idle main window frame as early as possible (refs #8826)

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

 modules/gui/macosx/MainWindow.h              |    1 +
 modules/gui/macosx/MainWindow.m              |   13 ++++++++-----
 modules/gui/macosx/VLCVoutWindowController.m |    3 +++
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index 9ce21b8..112e7b3 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -130,6 +130,7 @@
 
 - (void)showFullscreenController;
 
+- (void)videoplayWillBeStarted;
 - (void)setVideoplayEnabled;
 
 @end
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 259589a..2c30791 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -737,14 +737,17 @@ static VLCMainWindow *_o_sharedInstance = nil;
 #pragma mark -
 #pragma mark Video Output handling
 
+- (void)videoplayWillBeStarted
+{
+    if (!b_fullscreen)
+        frameBeforePlayback = [self frame];
+}
+
 - (void)setVideoplayEnabled
 {
     BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback];
-
-    if (b_videoPlayback) {
-        if (!b_fullscreen)
-            frameBeforePlayback = [self frame];
-    } else {
+        
+    if (!b_videoPlayback) {
         if (!b_nonembedded && (!b_nativeFullscreenMode || (b_nativeFullscreenMode && !b_fullscreen)) && frameBeforePlayback.size.width > 0 && frameBeforePlayback.size.height > 0)
             [[self animator] setFrame:frameBeforePlayback display:YES];
 
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index 0bd56d3..0ddc338 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -66,6 +66,9 @@
     VLCVoutView *o_vout_view;
     VLCVideoWindowCommon *o_new_video_window;
 
+    // should be called before any window resizing occurs
+    [[VLCMainWindow sharedInstance] videoplayWillBeStarted];
+
     if (b_multiple_vout_windows && b_video_wallpaper)
         b_video_wallpaper = false;
 



More information about the vlc-commits mailing list