diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-07-06 16:35:13 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-07-09 15:33:18 +0200 |
commit | fa62b9c4b857eab162282972bc33d2aa001f73e4 (patch) | |
tree | 455d74c6089e6a767d1c4c714a25826c515e1371 /vcl | |
parent | 1bb7761b0aa0c7c62806ccf8a8fde365d640cb37 (diff) |
Implement reading screen count and screen geometry
this improves restoring window location should it be within
the secondary screen
Change-Id: Iaac6bcead6bfcb7ae9eda579e5a4ad6b2482cc39
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/Qt5System.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx index 0de1940d9eff..ca533923913b 100644 --- a/vcl/qt5/Qt5System.cxx +++ b/vcl/qt5/Qt5System.cxx @@ -7,21 +7,23 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <QtWidgets/QApplication> +#include <QtWidgets/QDesktopWidget> + #include <string.h> #include <tools/gen.hxx> #include <Qt5System.hxx> +#include <Qt5Tools.hxx> Qt5System::Qt5System() {} Qt5System::~Qt5System() {} -unsigned int Qt5System::GetDisplayScreenCount() { return 1; } +unsigned int Qt5System::GetDisplayScreenCount() { return QApplication::desktop()->screenCount(); } tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) { - tools::Rectangle aRect; - if (nScreen == 0) - aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); - return aRect; + QRect qRect = QApplication::desktop()->screenGeometry(nScreen); + return toRectangle(qRect); } int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector<OUString>&) |