Commit 90237c30 authored by Felix Paul Kühne's avatar Felix Paul Kühne

vout_macosx: check whether the receiving window can respond to non-standard...

vout_macosx: check whether the receiving window can respond to non-standard calls prior to calling them (close #6034)
(cherry picked from commit fe53c6cd32682d52f740bc49767c5eab68632e51)
parent 32304937
...@@ -315,9 +315,15 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -315,9 +315,15 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_CHANGE_FULLSCREEN: case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{ {
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
[[sys->glView window] performSelectorOnMainThread:@selector(updateFullscreen) withObject: nil waitUntilDone:NO]; id window = [sys->glView window];
if ([window respondsToSelector:@selector(updateFullscreen)])
{
[[sys->glView window] performSelectorOnMainThread:@selector(updateFullscreen) withObject: nil waitUntilDone:NO];
[o_pool release];
return VLC_SUCCESS;
}
[o_pool release]; [o_pool release];
return VLC_SUCCESS; return VLC_EGENERIC;
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{ {
...@@ -560,11 +566,16 @@ static void OpenglSwap(vlc_gl_t *gl) ...@@ -560,11 +566,16 @@ static void OpenglSwap(vlc_gl_t *gl)
*/ */
- (void)setWindowFrameWithValue:(NSValue *)value - (void)setWindowFrameWithValue:(NSValue *)value
{ {
if (![[self window] isFullscreen]) id window = [self window];
NSRect frame = [value rectValue];
if ([window respondsToSelector:@selector(isFullscreen)])
{ {
NSRect frame = [value rectValue]; if (!(BOOL)[[self window] isFullscreen])
[[self window] setFrame:frame display:YES animate: YES]; [[self window] setFrame:frame display:YES animate:YES];
} }
else
[[self window] setFrame:frame display:YES animate:YES];
} }
/** /**
......
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