Commit ea98fcfc 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
parent b8f84e88
......@@ -54,6 +54,8 @@
if (p_vout)
vlc_object_release(p_vout);
[[NSNotificationCenter defaultCenter] removeObserver: self];
[self unregisterDraggedTypes];
[super dealloc];
}
......@@ -67,6 +69,14 @@
i_lastScrollWheelDirection = 0;
f_cumulated_magnification = 0.0;
#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
return self;
}
......@@ -217,7 +227,7 @@
i_yvlckey = KEY_MOUSEWHEELDOWN;
else
i_yvlckey = KEY_MOUSEWHEELUP;
if (f_deltaX < 0.0f)
i_xvlckey = KEY_MOUSEWHEELRIGHT;
else
......@@ -286,6 +296,23 @@
#pragma mark -
#pragma mark Basic view behaviour and touch events handling
- (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];
}
}
- (BOOL)mouseDownCanMoveWindow
{
return YES;
......
......@@ -200,7 +200,7 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
unsigned int i_width = va_arg(args, unsigned int);
unsigned int i_height = va_arg(args, unsigned int);
NSSize newSize = NSMakeSize(i_width, i_height);
NSSize newSize = NSMakeSize(i_width, i_height);
SEL sel = @selector(setNativeVideoSize:forWindow:);
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[[[VLCMain sharedInstance] voutController] methodSignatureForSelector:sel]];
[inv setTarget:[[VLCMain sharedInstance] voutController]];
......@@ -1237,9 +1237,8 @@ static VLCMain *_o_sharedMainInstance = nil;
playlist_t * p_playlist = pl_Get(p_intf);
BOOL b_fullscreen = i_full;
if (!var_GetBool(p_playlist, "fullscreen") != !b_fullscreen) {
if (!var_GetBool(p_playlist, "fullscreen") != !b_fullscreen)
var_SetBool(p_playlist, "fullscreen", b_fullscreen);
}
if (b_nativeFullscreenMode) {
// this is called twice in certain situations, so only toogle if we really need to
......
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