diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-02-11 11:22:30 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-02-11 14:13:17 +0100 |
commit | 9191b59ac13d59a50f88e74604f02eb97e969e89 (patch) | |
tree | c65512d61a4a27d927b0b948470478d08cc4e95e /vcl/qt5 | |
parent | 379ab849b415d61c542fc5ebd613e94052df4afb (diff) |
tdf#119853: Set window state only, don't actually show the window
showMaximized, showNormal etc. makes the windows visible, but it is
not always desirable (e.g. documents opened with 'hidden' flag on)
Change-Id: I15364c816c35865dbc2d74f1d1a46817b1277f43
Reviewed-on: https://gerrit.libreoffice.org/67679
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 55e0eea76ff7..512c15a8545c 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -280,6 +280,14 @@ bool Qt5Frame::isMaximized() const return m_pQWidget->isMaximized(); } +void Qt5Frame::SetWindowStateImpl(Qt::WindowStates eState) +{ + if (m_pTopLevel) + m_pTopLevel->setWindowState(eState); + else + m_pQWidget->setWindowState(eState); +} + void Qt5Frame::SetTitle(const OUString& rTitle) { m_pQWidget->window()->setWindowTitle(toQString(rTitle)); @@ -497,7 +505,19 @@ void Qt5Frame::SetWindowState(const SalFrameState* pState) if ((pState->mnMask & WindowStateMask::State) && (pState->mnState & WindowStateState::Maximized) && !isMaximized() && (pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask) - m_pQWidget->showMaximized(); + { + if (m_pTopLevel) + { + m_pTopLevel->resize(pState->mnWidth, pState->mnHeight); + m_pTopLevel->move(pState->mnX, pState->mnY); + } + else + { + m_pQWidget->resize(pState->mnWidth, pState->mnHeight); + m_pQWidget->move(pState->mnX, pState->mnY); + } + SetWindowStateImpl(Qt::WindowMaximized); + } else if (pState->mnMask & (WindowStateMask::X | WindowStateMask::Y | WindowStateMask::Width | WindowStateMask::Height)) @@ -525,16 +545,12 @@ void Qt5Frame::SetWindowState(const SalFrameState* pState) } else if (pState->mnMask & WindowStateMask::State && !isChild()) { - if (pState->mnState & WindowStateState::Maximized && m_pTopLevel) - { - m_pTopLevel->showMaximized(); - return; - } - - if ((pState->mnState & WindowStateState::Minimized) && isWindow()) - m_pQWidget->showMinimized(); + if (pState->mnState & WindowStateState::Maximized) + SetWindowStateImpl(Qt::WindowMaximized); + else if ((pState->mnState & WindowStateState::Minimized)) + SetWindowStateImpl(Qt::WindowMinimized); else - m_pQWidget->showNormal(); + SetWindowStateImpl(Qt::WindowNoState); } } |