[vlc-devel] commit: Fix ugly crashes related to the existing 'blackout screen' code ( Felix Paul Kühne )
git version control
git at videolan.org
Fri Mar 28 17:28:36 CET 2008
vlc | branch: 0.8.6-bugfix | Felix Paul Kühne <fkuehne at videolan.org> | Fri Mar 28 17:25:50 2008 +0100| [bb4e8b2d3c7283da4a47ae0dc3e5e48f1d11b5a6]
Fix ugly crashes related to the existing 'blackout screen' code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bb4e8b2d3c7283da4a47ae0dc3e5e48f1d11b5a6
---
modules/gui/macosx/embeddedwindow.m | 13 +++----------
modules/gui/macosx/misc.m | 17 ++++++++---------
2 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m
index ab712f8..85fc4f1 100644
--- a/modules/gui/macosx/embeddedwindow.m
+++ b/modules/gui/macosx/embeddedwindow.m
@@ -70,7 +70,6 @@
* in middle of an animation, providing that the enter/leave functions
* are called from the same thread */
o_animation_lock = [[NSRecursiveLock alloc] init];
- b_animation_lock_alreadylocked = NO;
}
- (void)setTime:(NSString *)o_arg_time position:(float)f_position
@@ -232,11 +231,7 @@
[self hasBecomeFullscreen];
return;
}
-
- if (blackout_other_displays)
- [screen blackoutOtherScreens]; /* We should do something like [screen blackoutOtherScreens]; */
-
- b_animation_lock_alreadylocked = NO;
+
[self unlockFullscreenAnimation];
}
@@ -274,8 +269,7 @@
{
/* We always try to do so */
[NSScreen unblackoutScreens];
-
- b_animation_lock_alreadylocked = NO;
+
[self unlockFullscreenAnimation];
return;
}
@@ -287,7 +281,7 @@
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
- SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
+ SetSystemUIMode( kUIModeNormal, 0);
/* We always try to do so */
[NSScreen unblackoutScreens];
@@ -320,7 +314,6 @@
[o_fullscreen_window release];
o_fullscreen_window = nil;
- b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation];
}
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index f5558e7..c52235b 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -79,10 +79,9 @@ static NSMutableArray *blackoutWindows = NULL;
unsigned int i;
/* Free our previous blackout window (follow blackoutWindow alloc strategy) */
- [blackoutWindows makeObjectsPerformSelector:@selector(close)];
+ [blackoutWindows makeObjectsPerformSelector:@selector(orderOut:)];
[blackoutWindows removeAllObjects];
-
for(i = 0; i < [[NSScreen screens] count]; i++)
{
NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
@@ -103,15 +102,15 @@ static NSMutableArray *blackoutWindows = NULL;
backing: NSBackingStoreBuffered defer: NO screen: screen];
[blackoutWindow setBackgroundColor:[NSColor blackColor]];
[blackoutWindow setLevel: NSFloatingWindowLevel]; /* Disappear when Expose is triggered */
-
+
[blackoutWindow displayIfNeeded];
[blackoutWindow orderFront: self];
[blackoutWindows addObject: blackoutWindow];
[blackoutWindow release];
-
- if( [screen isMainScreen] )
- SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+
+ if( [screen isMainScreen ] )
+ SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
}
}
@@ -122,10 +121,10 @@ static NSMutableArray *blackoutWindows = NULL;
for(i = 0; i < [blackoutWindows count]; i++)
{
VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i];
- [blackoutWindow close];
+ [blackoutWindow orderOut: self];
}
-
- SetSystemUIMode( kUIModeNormal, 0);
+
+ SetSystemUIMode( kUIModeNormal, 0);
}
@end
More information about the vlc-devel
mailing list