Skip to content

Commit

Permalink
Fix for dash-qt issue with startup and multiple monitors. (#1461)
Browse files Browse the repository at this point in the history
* Fix for issues with startup and multiple monitors on windows.

* Improvements to centering code after a suggestion from zander.
  • Loading branch information
AllanDoensen authored and UdjinM6 committed May 5, 2017
1 parent 82a4643 commit 9901cf4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,14 +889,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.center() -
QPoint(defaultSize.width() / 2, defaultSize.height() / 2);
parent->resize(defaultSize);
parent->move(defaultPos);
}
}

// Return name of current UI-theme or default theme if no theme was found
Expand Down

0 comments on commit 9901cf4

Please sign in to comment.