Commit 036fe1e1 authored by Ron Frederick's avatar Ron Frederick Committed by Felix Paul Kühne
Browse files

MacOS GUI: Tie display fade to "Black out" preference



Change the MacOS GUI to trigger the fade of all the displays to black
when entering & leaving full screen mode only if the "Black out other
displays" preference is set.
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 0d22c967
...@@ -481,8 +481,11 @@ ...@@ -481,8 +481,11 @@
* simply fade the display */ * simply fade the display */
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token); if( blackout_other_displays )
CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); {
CGAcquireDisplayFadeReservation( kCGMaxDisplayReservationInterval, &token );
CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
}
if ([screen isMainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
...@@ -496,8 +499,11 @@ ...@@ -496,8 +499,11 @@
[o_fullscreen_window setFrame:screen_rect display:YES]; [o_fullscreen_window setFrame:screen_rect display:YES];
CGDisplayFade( token, 0.3, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO ); if( blackout_other_displays )
CGReleaseDisplayFadeReservation( token); {
CGDisplayFade( token, 0.3, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
CGReleaseDisplayFadeReservation( token );
}
/* Will release the lock */ /* Will release the lock */
[self hasBecomeFullscreen]; [self hasBecomeFullscreen];
...@@ -599,6 +605,7 @@ ...@@ -599,6 +605,7 @@
{ {
NSMutableDictionary *dict1, *dict2; NSMutableDictionary *dict1, *dict2;
NSRect frame; NSRect frame;
BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" );
[self lockFullscreenAnimation]; [self lockFullscreenAnimation];
...@@ -621,8 +628,11 @@ ...@@ -621,8 +628,11 @@
* simply fade the display */ * simply fade the display */
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token); if( blackout_other_displays )
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); {
CGAcquireDisplayFadeReservation( kCGMaxDisplayReservationInterval, &token );
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
}
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil]; [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
...@@ -634,8 +644,12 @@ ...@@ -634,8 +644,12 @@
* here */ * here */
b_window_is_invisible = YES; b_window_is_invisible = YES;
CGDisplayFade( token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO ); if( blackout_other_displays )
CGReleaseDisplayFadeReservation( token); {
CGDisplayFade( token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
CGReleaseDisplayFadeReservation( token );
}
return; return;
} }
......
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