diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-08-24 12:22:52 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-07 06:14:02 +0000 |
commit | 1a5cc2a868969f1b1e9278c4145b7af2fc4b8f69 (patch) | |
tree | 361a81824bb5748c21736ebac830ff0eca5620c3 | |
parent | 6413ceeccff9078bc8ec2dcb63b445c031c420dd (diff) |
Cocoa: correct QDesktopWidget::availableGeometry()
Since 10.9, System Preferences->Mission Control->Displays have separate
Spaces settings needs to be followed.
Task-number: QTBUG-47030
Change-Id: I1c1cf326246bd5609090ce5ac3212d963d562593
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index c8f6dd05db..8f84539e04 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -86,9 +86,17 @@ void QCocoaScreen::updateGeometry() NSRect frameRect = [nsScreen frame]; - if (m_screenIndex == 0) { + // Since Mavericks, there is a setting, System Preferences->Mission Control-> + // Displays have separate Spaces. + BOOL spansDisplays = NO; +#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_9) + spansDisplays = [NSScreen screensHaveSeparateSpaces]; +#endif + if (spansDisplays || m_screenIndex == 0) { m_geometry = QRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width, frameRect.size.height); - // This is the primary screen, the one that contains the menubar. Its origin should be + // Displays have separate Spaces setting is on or this is the primary screen, + // the one that contains the menubar. Its origin should be // (0, 0), and it's the only one whose available geometry differs from its full geometry. NSRect visibleRect = [nsScreen visibleFrame]; m_availableGeometry = QRect(visibleRect.origin.x, |