[vlc-commits] macosx: make lion fullscreen compatible with reworked vout module
David Fuhrmann
git at videolan.org
Fri Apr 20 19:12:42 CEST 2012
vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Fri Apr 20 17:42:32 2012 +0200| [daceb54432580f1d18e27225b59d5a0720e48c8a] | committer: David Fuhrmann
macosx: make lion fullscreen compatible with reworked vout module
This also check if we should go to fullscreen at video startup (setting in video tab).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=daceb54432580f1d18e27225b59d5a0720e48c8a
---
modules/gui/macosx/MainWindow.m | 33 ++++++++++++++++++++++++++++-----
modules/gui/macosx/intf.m | 9 +++++++--
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 67028bc..5020b6b 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1514,8 +1514,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
{
BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback];
- if (!b_videoPlayback)
+ if( b_videoPlayback )
{
+ // look for 'start at fullscreen'
+ [[VLCMain sharedInstance] fullscreenChanged];
+
+ [self makeFirstResponder: o_video_view];
+ }
+ else
+ {
+ [self makeFirstResponder: nil];
[o_detached_video_window orderOut: nil];
// restore alpha value to 1 for the case that macosx-opaqueness is set to < 1
@@ -1531,10 +1539,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (!b_videoPlayback)
[o_fspanel setNonActive: nil];
}
- if (b_videoPlayback)
- [self makeFirstResponder: o_video_view];
- else
- [self makeFirstResponder: nil];
if (!b_videoPlayback && b_fullscreen)
{
@@ -2075,6 +2079,15 @@ static VLCMainWindow *_o_sharedInstance = nil;
#pragma mark Lion native fullscreen handling
- (void)windowWillEnterFullScreen:(NSNotification *)notification
{
+ var_SetBool( pl_Get( VLCIntf ), "fullscreen", true );
+
+ vout_thread_t *p_vout = getVout();
+ if( p_vout )
+ {
+ var_SetBool( p_vout, "fullscreen", true );
+ vlc_object_release( p_vout );
+ }
+
[o_video_view setFrame: [[self contentView] frame]];
b_fullscreen = YES;
[o_fspanel setVoutWasUpdated: (int)[[self screen] displayID]];
@@ -2105,6 +2118,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)windowWillExitFullScreen:(NSNotification *)notification
{
+
+ var_SetBool( pl_Get( VLCIntf ), "fullscreen", false );
+
+ vout_thread_t *p_vout = getVout();
+ if( p_vout )
+ {
+ var_SetBool( p_vout, "fullscreen", false );
+ vlc_object_release( p_vout );
+ }
+
[o_video_view setFrame: [o_split_view frame]];
[NSCursor setHiddenUntilMouseMoves: NO];
[o_fspanel setNonActive: nil];
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index e06299b..93a6696 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -169,7 +169,8 @@ static int WindowControl( vout_window_t *p_wnd, int i_query, va_list args )
else if( i_query == VOUT_WINDOW_SET_FULLSCREEN )
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
- [[VLCMain sharedInstance] fullscreenChanged];
+ // we already have our playlist "fullscreen" callback, do not repeat the same call here
+ //[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(fullscreenChanged) withObject: nil waitUntilDone: NO];
[o_pool release];
}
else
@@ -1385,7 +1386,11 @@ unsigned int CocoaKeyToVLC( unichar i_key )
if (b_nativeFullscreenMode)
{
- [o_mainwindow toggleFullScreen: self];
+ // this is called twice in certain situations, so only toogle if we really need to
+ if( ( b_fullscreen && !([NSApp currentSystemPresentationOptions] & NSApplicationPresentationFullScreen) ) ||
+ ( !b_fullscreen && ([NSApp currentSystemPresentationOptions] & NSApplicationPresentationFullScreen) ) )
+ [o_mainwindow toggleFullScreen: self];
+
if(b_fullscreen)
[NSApp setPresentationOptions:(NSApplicationPresentationFullScreen | NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
else
More information about the vlc-commits
mailing list