aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Doensen <allan@doensen.com>2017-04-04 23:37:39 +1000
committerWladimir J. van der Laan <laanwj@gmail.com>2017-04-10 11:17:12 +0200
commite9ff818b69c2f8ce4a151d1a81a3e22a4319c93d (patch)
tree6c839b38bd5304f8cf41b40b2ca6fb421e2e58c8
parentf93f9b92969b4a3f77d3f1c2a30ba3bf558e0cac (diff)
Fix for issues with startup and multiple monitors on windows.
-rw-r--r--src/qt/guiutil.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index bb5b2d4347..a66a0218cf 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -843,14 +843,17 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize,
QPoint pos = settings.value(strSetting + "Pos").toPoint();
QSize size = settings.value(strSetting + "Size", defaultSize).toSize();
- if (!pos.x() && !pos.y()) {
- QRect screen = QApplication::desktop()->screenGeometry();
- pos.setX((screen.width() - size.width()) / 2);
- pos.setY((screen.height() - size.height()) / 2);
- }
-
parent->resize(size);
parent->move(pos);
+
+ if ((!pos.x() && !pos.y()) || (QApplication::desktop()->screenNumber(parent) == -1))
+ {
+ QRect screen = QApplication::desktop()->screenGeometry();
+ QPoint defaultPos((screen.width() - defaultSize.width()) / 2,
+ (screen.height() - defaultSize.height()) / 2);
+ parent->resize(defaultSize);
+ parent->move(defaultPos);
+ }
}
void setClipboard(const QString& str)