summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-07-06 17:03:41 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-07-07 10:36:54 +0000
commit9d3cd2268ce3beafcf6fa886bb70d8463260d602 (patch)
tree8e81a81e275b60a095e2c309962f6d1b410fe997
parent3fb08520914e6d2ff125e54ebccf0c9a77a0034c (diff)
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>
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.mm15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index ce74aa9973..a18fe693fa 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -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);