summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2019-02-26 15:07:51 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-03-21 17:11:06 +0100
commitc4e9ed5f2614ae69f838cfca4621e1ecc56cba9b (patch)
treee83c38e5a0a742f67ca289b077ae2b9a339832a0 /vcl
parentf735f010a876a531532b9c6759f8f1cf48c5a6fa (diff)
tdf#120791: restore window geometry coming back from fullscreen
Change-Id: I1492423fe6110bdc79aa68c715e968770f6767ab Reviewed-on: https://gerrit.libreoffice.org/68672 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit e8e274b50658e1f9c2f40ce05249f7c857aeba64) Reviewed-on: https://gerrit.libreoffice.org/69510 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/qt5/Qt5Frame.hxx1
-rw-r--r--vcl/qt5/Qt5Frame.cxx16
2 files changed, 14 insertions, 3 deletions
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 4a1dc6767d95..239666ca179f 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -81,6 +81,7 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public QObject, public SalFrame
bool m_bDefaultSize;
bool m_bDefaultPos;
bool m_bFullScreen;
+ QRect m_aRestoreGeometry;
void Center();
Size CalcDefaultSize();
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 57a2cb219b52..3172b769f550 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -612,9 +612,19 @@ void Qt5Frame::ShowFullScreen(bool bFullScreen, sal_Int32 nScreen)
if (!isWindow())
m_pTopLevel->show();
- // do that before going fullscreen
- SetScreenNumber(nScreen);
- m_bFullScreen ? windowHandle()->showFullScreen() : windowHandle()->showNormal();
+ if (m_bFullScreen)
+ {
+ m_aRestoreGeometry = m_pTopLevel->geometry();
+ // do that before going fullscreen
+ SetScreenNumber(nScreen);
+ windowHandle()->showFullScreen();
+ }
+ else
+ {
+ windowHandle()->showNormal();
+ m_pTopLevel->setGeometry(m_aRestoreGeometry);
+ m_aRestoreGeometry = QRect();
+ }
}
void Qt5Frame::StartPresentation(bool)