Commit a34b8d76 authored by David Fuhrmann's avatar David Fuhrmann

macosx: do not (mis)use the content view as the video view in fullscreen

The content view can never be nil, so methods like removeFromSuperView
which are used do not work as expected. Thus, it was possible that the
content view is a dangling pointer, causing crashes when trying to draw
the window.
parent 113917a4
......@@ -223,8 +223,13 @@
- (VLCVoutView *)videoView
{
if ([[self contentView] class] == [VLCVoutView class])
return (VLCVoutView *)[self contentView];
NSArray *o_subViews = [[self contentView] subviews];
if ([o_subViews count] > 0) {
id o_vout_view = [o_subViews objectAtIndex:0];
if ([o_vout_view class] == [VLCVoutView class])
return (VLCVoutView *)o_vout_view;
}
return nil;
}
......@@ -900,7 +905,8 @@
[o_video_view retain];
[[o_video_view superview] replaceSubview:o_video_view with:o_temp_view];
[o_temp_view setFrame:[o_video_view frame]];
[o_fullscreen_window setContentView:o_video_view];
[[o_fullscreen_window contentView] addSubview:o_video_view];
[o_video_view setFrame: [[o_fullscreen_window contentView] frame]];
[o_video_view release];
NSEnableScreenUpdates();
......@@ -928,7 +934,8 @@
[o_video_view retain];
[[o_video_view superview] replaceSubview:o_video_view with:o_temp_view];
[o_temp_view setFrame:[o_video_view frame]];
[o_fullscreen_window setContentView:o_video_view];
[[o_fullscreen_window contentView] addSubview:o_video_view];
[o_video_view setFrame: [[o_fullscreen_window contentView] frame]];
[o_video_view release];
[o_fullscreen_window makeKeyAndOrderFront:self];
NSEnableScreenUpdates();
......
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