macOS: Account for fullscreen geometry bug in AppKit on OS X 10.10

Task-number: QTBUG-61776
Change-Id: Ifac502cf422088eafe9211d759f2f5cd9769d0d3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
bb10
Tor Arne Vestbø 2017-07-06 17:03:41 +02:00
parent 3fb0852091
commit 9d3cd2268c
1 changed files with 15 additions and 0 deletions

View File

@ -78,6 +78,21 @@
return m_cocoaWindow->screen()->availableGeometry().toCGRect();
}
#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
/*
AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame
from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting
in black bars on top and bottom of the window. By implementing the following
method, AppKit will choose that instead, and resolve the right fullscreen
geometry.
*/
- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
{
Q_ASSERT(NSEqualSizes(m_cocoaWindow->screen()->geometry().size().toCGSize(), proposedSize));
return proposedSize;
}
#endif
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
{
Q_UNUSED(window);