[Libreoffice-commits] core.git: vcl/qt5
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 23 07:11:43 UTC 2018
vcl/qt5/Qt5Frame.cxx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit f806a2832aee62efc0e0404f7c24d53aaaf814d0
Author: Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Mon Oct 22 16:35:21 2018 +0200
Commit: Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Tue Oct 23 09:11:21 2018 +0200
tdf#120451: Use primary screen if requested screen doesn't exist
Change-Id: I3e570bdeddc82f1d8cd46a362964e53527e6c152
Reviewed-on: https://gerrit.libreoffice.org/62193
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 ff77638013ca..4847546f200d 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -839,7 +839,17 @@ void Qt5Frame::SetScreenNumber(unsigned int nScreen)
{
QWindow* const pWindow = windowHandle();
if (pWindow)
- pWindow->setScreen(QApplication::screens()[nScreen]);
+ {
+ QList<QScreen*> screens = QApplication::screens();
+ if (static_cast<int>(nScreen) < screens.size())
+ pWindow->setScreen(QApplication::screens()[nScreen]);
+ else
+ {
+ // index outta bounds, use primary screen
+ QScreen* primaryScreen = QApplication::primaryScreen();
+ pWindow->setScreen(primaryScreen);
+ }
+ }
}
}
More information about the Libreoffice-commits
mailing list