Commit 8840aa58 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx: Correctly close the vout window if there is no video for 1.5sec.

parent e74dad9a
...@@ -896,6 +896,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -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 frame: (NSRect *)s_arg_frame showWindow: (BOOL)b_show_window
{ {
BOOL b_return; BOOL b_return;
[NSObject cancelPreviousPerformRequestsWithTarget:o_window];
b_return = [super setVout: p_arg_vout subView: view frame: s_arg_frame]; b_return = [super setVout: p_arg_vout subView: view frame: s_arg_frame];
if( b_return ) if( b_return )
{ {
...@@ -964,6 +967,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -964,6 +967,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[self updateTitle]; [self updateTitle];
[NSObject cancelPreviousPerformRequestsWithTarget:o_window];
/* Make the window the front and key window before animating */ /* Make the window the front and key window before animating */
if ([o_window isVisible] && (![o_window isFullscreen])) if ([o_window isVisible] && (![o_window isFullscreen]))
[o_window makeKeyAndOrderFront: self]; [o_window makeKeyAndOrderFront: self];
...@@ -983,17 +988,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -983,17 +988,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)closeVout - (void)closeVout
{ {
playlist_t * p_playlist = pl_Yield( VLCIntf ); /* Don't close the window yet, wait a bit to see if a new input is poping up */
PL_LOCK; /* FIXME: Probably fade the window In and Out */
bool stopped = playlist_IsStopped( p_playlist ); /* FIXME: fix core */
PL_UNLOCK; [o_window performSelector:@selector(orderOut:) withObject:nil afterDelay:1.5];
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 );
[super closeVout]; [super closeVout];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment