Fixed an issue in InputImpl::getSFOpenGLViewFromSFMLWindow failing to retrieve the SFOpenGLView from the contentview's subview when using fullscreen (see issue #782).

This commit is contained in:
Thom Robinson (Macbook Pro) 2015-02-03 16:11:54 +01:00 committed by Lukas Dürrenberger
parent 1f2bc148fe
commit d83ddd56e3

View File

@ -70,9 +70,26 @@ SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window)
// Subview doesn't match ?
if (![view isKindOfClass:[SFOpenGLView class]])
{
sf::err() << "The content view is not a valid SFOpenGLView"
<< std::endl;
view = nil;
if([view isKindOfClass:[NSView class]])
{
NSArray* subviews = [view subviews];
for (NSView* subview in subviews)
{
if ([subview isKindOfClass:[SFOpenGLView class]])
{
view = (SFOpenGLView*)subview;
break;
}
}
}
else
{
sf::err() << "The content view is not a valid SFOpenGLView"
<< std::endl;
view = nil;
}
}
}