diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-05-08 14:02:37 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-05-10 17:24:44 +0200 |
commit | 758c44f69f0a0ed4a501695de4f065824325e750 (patch) | |
tree | c7f76aa9dc49ae2dd77f587e93e37d90d233a785 /vcl/qt5 | |
parent | f43b5d1e6035e6ed619ab425009a7895ac271716 (diff) |
tdf#124484: avoid crash in fullscreen slideshow spanning all displays
This just stops the bleeding (crash) in a special case when screen
number argument of SalFrame::ShowFullScreen is -1 (meaning
'fullscreen spanning all available displays')
It doesn't yet extend the fullscreen window over all screens, this
will be done in a follow-up fix
Change-Id: I2cf48096a1fe1ec33c943f10acb41c59585b325f
Reviewed-on: https://gerrit.libreoffice.org/71965
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 05e17932a93c..5ed722aad391 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -1069,12 +1069,26 @@ void Qt5Frame::SetScreenNumber(unsigned int nScreen) QList<QScreen*> screens = QApplication::screens(); if (static_cast<int>(nScreen) < screens.size()) { - QWidget* const pWidget = m_pTopLevel ? m_pTopLevel : m_pQWidget; - pWindow->setScreen(QApplication::screens()[nScreen]); + bool bSpanAllScreens = (nScreen == static_cast<unsigned int>(-1)); + QRect screenGeo; + + if (!bSpanAllScreens) + { + screenGeo = QApplication::desktop()->screenGeometry(nScreen); + pWindow->setScreen(QApplication::screens()[nScreen]); + } + else // special case: fullscreen over all available screens + { + // left-most screen + int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 0)); + // entire virtual desktop + screenGeo = QApplication::screens()[nLeftScreen]->availableVirtualGeometry(); + pWindow->setScreen(QApplication::screens()[nLeftScreen]); + } // setScreen by itself has no effect, explicitly move the widget to // the new screen - QRect screenGeo = QApplication::desktop()->screenGeometry(nScreen); + QWidget* const pWidget = m_pTopLevel ? m_pTopLevel : m_pQWidget; pWidget->move(screenGeo.topLeft()); } else |