[vlc-devel] commit: macosx: Correctly close the vout window if there is no video for 1. 5sec. (Pierre d'Herbemont )
git version control
git at videolan.org
Tue Jul 8 02:11:40 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Jul 8 02:13:53 2008 +0200| [8840aa586a3fa553dcc7a6c5b4b6edf9e5743644]
macosx: Correctly close the vout window if there is no video for 1.5sec.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8840aa586a3fa553dcc7a6c5b4b6edf9e5743644
---
modules/gui/macosx/vout.m | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m
index a59b6f6..dfc756b 100644
--- a/modules/gui/macosx/vout.m
+++ b/modules/gui/macosx/vout.m
@@ -896,6 +896,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
frame: (NSRect *)s_arg_frame showWindow: (BOOL)b_show_window
{
BOOL b_return;
+
+ [NSObject cancelPreviousPerformRequestsWithTarget:o_window];
+
b_return = [super setVout: p_arg_vout subView: view frame: s_arg_frame];
if( b_return )
{
@@ -964,6 +967,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[self updateTitle];
+ [NSObject cancelPreviousPerformRequestsWithTarget:o_window];
+
/* Make the window the front and key window before animating */
if ([o_window isVisible] && (![o_window isFullscreen]))
[o_window makeKeyAndOrderFront: self];
@@ -983,17 +988,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)closeVout
{
- playlist_t * p_playlist = pl_Yield( VLCIntf );
- PL_LOCK;
- bool stopped = playlist_IsStopped( p_playlist );
- PL_UNLOCK;
-
- if(stopped)
- [o_window performSelectorOnMainThread: @selector(orderOut:) withObject: self waitUntilDone: YES];
- else
- msg_Dbg( VLCIntf, "we are not closing the window, playlist is playing" );
-
- vlc_object_release( p_playlist );
+ /* Don't close the window yet, wait a bit to see if a new input is poping up */
+ /* FIXME: Probably fade the window In and Out */
+ /* FIXME: fix core */
+ [o_window performSelector:@selector(orderOut:) withObject:nil afterDelay:1.5];
[super closeVout];
}
More information about the vlc-devel
mailing list