[Libreoffice-commits] core.git: vcl/qt5

Katarina Behrens (via logerrit) logerrit at kemper.freedesktop.org
Fri May 10 15:25:36 UTC 2019


 vcl/qt5/Qt5Frame.cxx |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 758c44f69f0a0ed4a501695de4f065824325e750
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Wed May 8 14:02:37 2019 +0200
Commit:     Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Fri May 10 17:24:44 2019 +0200

    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 at cib.de>

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


More information about the Libreoffice-commits mailing list