[vlc-commits] macosx: fixed pl counter and make sure we pause the input on minimaturize ( closes #5809)

Felix Paul Kühne git at videolan.org
Sun Jan 8 15:08:39 CET 2012


vlc/vlc-1.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jan  8 14:05:52 2012 +0100| [8af341cda8d76c8af2816cc164b7d3dea146ea5e] | committer: Jean-Baptiste Kempf

macosx: fixed pl counter and make sure we pause the input on minimaturize (closes #5809)
(cherry picked from commit af6ffdaac40af9e5622e7521693f0186865e0e97)

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

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

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

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index ffcb10a..36bca2d 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -442,6 +442,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [o_time_sld_fancygradient_view removeFromSuperviewWithoutNeedingDisplay];
 
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(someWindowWillClose:) name: NSWindowWillCloseNotification object: nil];
+    [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(someWindowWillMiniaturize:) name: NSWindowWillMiniaturizeNotification object:nil];
 }
 
 #pragma mark -
@@ -1054,6 +1055,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     else
         [self showDropZone];
     PL_UNLOCK;
+    [o_sidebar_view setNeedsDisplay:YES];
 }
 
 - (void)setPause
@@ -1239,6 +1241,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [[VLCCoreInteraction sharedInstance] stop];
 }
 
+- (void)someWindowWillMiniaturize:(NSNotification *)notification
+{
+    if([notification object] == o_nonembedded_window || [notification object] == self)
+        [[VLCCoreInteraction sharedInstance] pause];
+}
+
 #pragma mark -
 #pragma mark Fullscreen support
 - (void)showFullscreenController
@@ -1849,7 +1857,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         NSInteger i_playlist_size;
 
         PL_LOCK;
-        i_playlist_size = playlist_CurrentSize( p_playlist );
+        i_playlist_size = p_playlist->items.i_size;
         PL_UNLOCK;
 
         return i_playlist_size;



More information about the vlc-commits mailing list