[vlc-commits] macosx: close the right window when pressing Cmd+W

David Fuhrmann git at videolan.org
Tue Feb 28 17:12:53 CET 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Feb 28 15:26:05 2012 +0100| [52b50d0c438e6aa78465a1b0361807985d6d861a] | committer: Felix Paul Kühne

macosx: close the right window when pressing Cmd+W

For nonembedded mode, this makes sure that:
- playlist window can be closed and video continues playing
- video will be stopped when closing video window with Cmd+W

Close #6239

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
(cherry picked from commit cf461cc05b82b45499f368f1a19944e6051fc91b)

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

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

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 3989c35..08bd195 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -800,14 +800,21 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (void)performClose:(id)sender
 {
+    NSWindow *o_key_window = [NSApp keyWindow];
+
     if (b_dark_interface)
     {
-        [self orderOut: sender];
-        if ([[VLCMain sharedInstance] activeVideoPlayback] && !b_nonembedded)
+        [o_key_window orderOut: sender];
+        if ( [[VLCMain sharedInstance] activeVideoPlayback] && ( !b_nonembedded || o_key_window != self ))
             [[VLCCoreInteraction sharedInstance] stop];
     }
     else
-        [super performClose: sender];
+    {
+        if( b_nonembedded && o_key_window != self )
+            [o_nonembedded_window performClose: sender];
+        else
+            [super performClose: sender];
+    }
 }
 
 - (void)performMiniaturize:(id)sender



More information about the vlc-commits mailing list