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

@ -69,11 +69,28 @@ SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window)
// Subview doesn't match ? // Subview doesn't match ?
if (![view isKindOfClass:[SFOpenGLView class]]) if (![view isKindOfClass:[SFOpenGLView class]])
{
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" sf::err() << "The content view is not a valid SFOpenGLView"
<< std::endl; << std::endl;
view = nil; view = nil;
} }
}
} }
else if ([nsHandle isKindOfClass:[NSView class]]) else if ([nsHandle isKindOfClass:[NSView class]])