OS X: Do not restore full screen state

Change-Id: I27398fac4591adcecabbb7945f4f6f0486ed2cb2
Task-number: QTCREATORBUG-10275
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-03-26 11:34:14 +01:00
parent f08af0d6db
commit f1057c4df2

View File

@@ -978,6 +978,12 @@ void MainWindow::writeSettings()
if (!(m_overrideColor.isValid() && StyleHelper::baseColor() == m_overrideColor))
settings->setValue(QLatin1String(colorKey), StyleHelper::requestedBaseColor());
// On OS X applications usually do not restore their full screen state.
// To be able to restore the correct non-full screen geometry, we have to put
// the window out of full screen before saving the geometry.
// Works around QTBUG-45241
if (Utils::HostOsInfo::isMacHost() && isFullScreen())
setWindowState(windowState() & ~Qt::WindowFullScreen);
settings->setValue(QLatin1String(windowGeometryKey), saveGeometry());
settings->setValue(QLatin1String(windowStateKey), saveState());
settings->setValue(QLatin1String(modeSelectorVisibleKey), ModeManager::isModeSelectorVisible());