I've managed to fix the problem for myself. The main problem lies within InputImp::getSFOpenGLViewFromSFMLWindow.
SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window)
{
id nsHandle = (id)window.getSystemHandle();
// Get our SFOpenGLView from ...
SFOpenGLView* view = nil;
if ([nsHandle isKindOfClass:[NSWindow class]])
{
// If system handle is a window then from its content view.
view = [nsHandle contentView];
// Subview doesn't match ?
if (![view isKindOfClass:[SFOpenGLView class]])
{
sf::err() << "The content view is not a valid SFOpenGLView"
<< std::endl;
view = nil;
}
}
else if ([nsHandle isKindOfClass:[NSView class]])
{
// If system handle is a view then from a subview of kind SFOpenGLView.
NSArray* subviews = [nsHandle subviews];
for (NSView* subview in subviews)
{
if ([subview isKindOfClass:[SFOpenGLView class]])
{
view = (SFOpenGLView*)subview;
break;
}
}
// No matching subview ?
if (view == nil)
sf::err() << "Cannot find a valid SFOpenGLView subview." << std::endl;
}
else
{
if (nsHandle != 0)
sf::err() << "The system handle is neither a <NSWindow*> nor <NSView*>"
<< "object. This shouldn't happen."
<< std::endl;
// Else: this probably means the SFML window was previously closed.
}
return view;
}
When a window is created with fullscreen mode (see SFWindowController::setupFullscreenViewTithMode) a NSView called masterview is created with the SFLOpenGLView added as subview of this NSView. This NSView is then set as the window's contentview. This means that whenever InputImp::getSFOpenGLViewFromSFMLWindow is called during fulllscreen mode it'll try to get the SFOpenGLView from the contentview which fails because it's a regular NSView, not a SFOpenGLView. It should try to get the SFOpenGLView from the contentview's subviews instead of the contentview itself.