Commit bb4e8b2d authored by Felix Paul Kühne's avatar Felix Paul Kühne

Fix ugly crashes related to the existing 'blackout screen' code

parent 96e55590
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
* in middle of an animation, providing that the enter/leave functions * in middle of an animation, providing that the enter/leave functions
* are called from the same thread */ * are called from the same thread */
o_animation_lock = [[NSRecursiveLock alloc] init]; o_animation_lock = [[NSRecursiveLock alloc] init];
b_animation_lock_alreadylocked = NO;
} }
- (void)setTime:(NSString *)o_arg_time position:(float)f_position - (void)setTime:(NSString *)o_arg_time position:(float)f_position
...@@ -232,11 +231,7 @@ ...@@ -232,11 +231,7 @@
[self hasBecomeFullscreen]; [self hasBecomeFullscreen];
return; return;
} }
if (blackout_other_displays)
[screen blackoutOtherScreens]; /* We should do something like [screen blackoutOtherScreens]; */
b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation]; [self unlockFullscreenAnimation];
} }
...@@ -274,8 +269,7 @@ ...@@ -274,8 +269,7 @@
{ {
/* We always try to do so */ /* We always try to do so */
[NSScreen unblackoutScreens]; [NSScreen unblackoutScreens];
b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation]; [self unlockFullscreenAnimation];
return; return;
} }
...@@ -287,7 +281,7 @@ ...@@ -287,7 +281,7 @@
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil]; [[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeNormal, 0);
/* We always try to do so */ /* We always try to do so */
[NSScreen unblackoutScreens]; [NSScreen unblackoutScreens];
...@@ -320,7 +314,6 @@ ...@@ -320,7 +314,6 @@
[o_fullscreen_window release]; [o_fullscreen_window release];
o_fullscreen_window = nil; o_fullscreen_window = nil;
b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation]; [self unlockFullscreenAnimation];
} }
......
...@@ -79,10 +79,9 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -79,10 +79,9 @@ static NSMutableArray *blackoutWindows = NULL;
unsigned int i; unsigned int i;
/* Free our previous blackout window (follow blackoutWindow alloc strategy) */ /* Free our previous blackout window (follow blackoutWindow alloc strategy) */
[blackoutWindows makeObjectsPerformSelector:@selector(close)]; [blackoutWindows makeObjectsPerformSelector:@selector(orderOut:)];
[blackoutWindows removeAllObjects]; [blackoutWindows removeAllObjects];
for(i = 0; i < [[NSScreen screens] count]; i++) for(i = 0; i < [[NSScreen screens] count]; i++)
{ {
NSScreen *screen = [[NSScreen screens] objectAtIndex: i]; NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
...@@ -103,15 +102,15 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -103,15 +102,15 @@ static NSMutableArray *blackoutWindows = NULL;
backing: NSBackingStoreBuffered defer: NO screen: screen]; backing: NSBackingStoreBuffered defer: NO screen: screen];
[blackoutWindow setBackgroundColor:[NSColor blackColor]]; [blackoutWindow setBackgroundColor:[NSColor blackColor]];
[blackoutWindow setLevel: NSFloatingWindowLevel]; /* Disappear when Expose is triggered */ [blackoutWindow setLevel: NSFloatingWindowLevel]; /* Disappear when Expose is triggered */
[blackoutWindow displayIfNeeded]; [blackoutWindow displayIfNeeded];
[blackoutWindow orderFront: self]; [blackoutWindow orderFront: self];
[blackoutWindows addObject: blackoutWindow]; [blackoutWindows addObject: blackoutWindow];
[blackoutWindow release]; [blackoutWindow release];
if( [screen isMainScreen] ) if( [screen isMainScreen ] )
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
} }
} }
...@@ -122,10 +121,10 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -122,10 +121,10 @@ static NSMutableArray *blackoutWindows = NULL;
for(i = 0; i < [blackoutWindows count]; i++) for(i = 0; i < [blackoutWindows count]; i++)
{ {
VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i]; VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i];
[blackoutWindow close]; [blackoutWindow orderOut: self];
} }
SetSystemUIMode( kUIModeNormal, 0); SetSystemUIMode( kUIModeNormal, 0);
} }
@end @end
......
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