diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-04-10 11:34:09 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-04-10 11:34:20 +0200 |
commit | 51833a17347fdc3615afb693e4ff8d347fc2eda2 (patch) | |
tree | 2ece7986dbc85cb874477d85d1de832a079bea5e | |
parent | 1fa4ae67a330c99a09392922f95b5efbea395a1d (diff) | |
parent | e9ff818b69c2f8ce4a151d1a81a3e22a4319c93d (diff) | |
download | bitcoin-51833a17347fdc3615afb693e4ff8d347fc2eda2.tar.xz |
Merge #10156: Fix for issues with startup and multiple monitors on windows.
e9ff818 Fix for issues with startup and multiple monitors on windows. (Allan Doensen)
Tree-SHA512: 8502042a9b5a2fd6f5e409163bee9bd7c85e34c158754f393065f8cc6cdd0f8505b9a1803069d01fc1fb2df04d1b2ed6291388851f2ed3608eb2dd53fc22e06e
-rw-r--r-- | src/qt/guiutil.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index cab8295006..3f3f9b9ccb 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -855,14 +855,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) |