[vlc-commits] macosx: some improvements to the non-embedded vout window
Felix Paul Kühne
git at videolan.org
Sun Jan 8 01:22:54 CET 2012
vlc/vlc-1.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat Jan 7 17:12:37 2012 +0100| [1c89be66cc2a665637d6c4bcc48d705704324aa9] | committer: Jean-Baptiste Kempf
macosx: some improvements to the non-embedded vout window
(cherry picked from commit a7026d196a8c6e154079873b2592d684ae1131ef)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=1c89be66cc2a665637d6c4bcc48d705704324aa9
---
modules/gui/macosx/MainWindow.m | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index c30ab25..7b70c89 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -396,6 +396,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setBackgroundColor: [NSColor clearColor]];
[self setOpaque: NO];
+ [self setHasShadow:YES];
NSRect winrect;
CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
@@ -430,6 +431,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (OSX_LEOPARD)
[o_time_sld_fancygradient_view removeFromSuperviewWithoutNeedingDisplay];
+
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(someWindowWillClose:) name: NSWindowWillCloseNotification object: nil];
}
#pragma mark -
@@ -700,6 +703,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
{
if (b_dark_interface)
[o_titlebar_view setWindowTitle: title];
+ if (b_nonembedded && [[VLCMain sharedInstance] activeVideoPlayback])
+ [o_nonembedded_window setTitle: title];
[super setTitle: title];
}
@@ -1069,11 +1074,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
else
{
- [o_video_view removeFromSuperviewWithoutNeedingDisplay];
+ if ([o_video_view superview] != NULL)
+ [o_video_view removeFromSuperviewWithoutNeedingDisplay];
if (o_nonembedded_window)
[o_nonembedded_window release];
- o_nonembedded_window = [[VLCWindow alloc] initWithContentRect:[o_video_view frame] styleMask: NSBorderlessWindowMask|NSResizableWindowMask backing:NSBackingStoreBuffered defer:YES];
+ o_nonembedded_window = [[VLCWindow alloc] initWithContentRect:[o_video_view frame] styleMask: NSTitledWindowMask|NSClosableWindowMask|NSResizableWindowMask|NSMiniaturizableWindowMask backing:NSBackingStoreBuffered defer:YES];
[o_nonembedded_window setFrame:[o_video_view frame] display:NO];
[o_nonembedded_window setBackgroundColor: [NSColor blackColor]];
[o_nonembedded_window setMovableByWindowBackground: YES];
@@ -1187,6 +1193,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
[NSCursor setHiddenUntilMouseMoves: YES];
}
+- (void)someWindowWillClose:(NSNotification *)notification
+{
+ if([notification object] == o_nonembedded_window)
+ [[VLCCoreInteraction sharedInstance] stop];
+}
+
#pragma mark -
#pragma mark Fullscreen support
- (void)showFullscreenController
More information about the vlc-commits
mailing list