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

macosx: fixed subtitle rendering resolution when using the native fullscreen mode (close #7946)

bug was triggered only when using controls provided by the OS like NSWindow's fullscreen button
(cherry picked from commit ea98fcfc60555b5f06a7149b8142be0bfcfb2be8)

Conflicts:
	modules/gui/macosx/VideoView.m
	modules/gui/macosx/intf.m
parent a1f97b91
Changes between 2.0.5 and 2.0.6: Changes between 2.0.5 and 2.0.6:
-------------------------------- --------------------------------
Mac OS X:
* Fix subtitle rendering resolution when using OS X's native fullscreen mode
Changes between 2.0.4 and 2.0.5: Changes between 2.0.4 and 2.0.5:
-------------------------------- --------------------------------
......
...@@ -68,15 +68,42 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -68,15 +68,42 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self];
[self unregisterDraggedTypes]; [self unregisterDraggedTypes];
[super dealloc]; [super dealloc];
} }
- (void)awakeFromNib - (void)awakeFromNib
{ {
#ifdef MAC_OS_X_VERSION_10_7
if (!OSX_SNOW_LEOPARD) {
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(osWillChangeFullScreenStatus:) name: NSWindowWillEnterFullScreenNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(osWillChangeFullScreenStatus:) name: NSWindowDidEnterFullScreenNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(osWillChangeFullScreenStatus:) name: NSWindowWillExitFullScreenNotification object: nil];
}
#endif
[self registerForDraggedTypes:[NSArray arrayWithObject: NSFilenamesPboardType]]; [self registerForDraggedTypes:[NSArray arrayWithObject: NSFilenamesPboardType]];
} }
- (void)osWillChangeFullScreenStatus:(NSNotification *)notification
{
playlist_t *p_playlist = pl_Get(VLCIntf);
if ([notification.name isEqualToString:@"NSWindowWillEnterFullScreenNotification"] || [notification.name isEqualToString:@"NSWindowDidEnterFullScreenNotification"])
var_SetBool(p_playlist, "fullscreen", 1);
else
var_SetBool(p_playlist, "fullscreen", 0);
NSArray *subviews = [self subviews];
NSUInteger count = [subviews count];
for (NSUInteger x = 0; x < count; x++) {
if ([[subviews objectAtIndex:x] respondsToSelector:@selector(reshape)])
[[subviews objectAtIndex:x] reshape];
}
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{ {
if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) == NSDragOperationGeneric) if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) == NSDragOperationGeneric)
......
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