Skip to content

Commit

Permalink
Fixing offscreen GUI issue
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#11208
Rebased-From: 7765030
  • Loading branch information
meshcollider authored and luke-jr committed Sep 2, 2017
1 parent c2704ec commit 80b0f37
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,10 +857,9 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize,

parent->resize(size);
parent->move(pos);

if ((!pos.x() && !pos.y()) || (QApplication::desktop()->screenNumber(parent) == -1))
{
QRect screen = QApplication::desktop()->screenGeometry();

QRect screen = QApplication::desktop()->screenGeometry();
if ((!pos.x() && !pos.y()) || pos.x() > screen.width() || pos.y() > screen.height() || (QApplication::desktop()->screenNumber(parent) == -1)) {
QPoint defaultPos((screen.width() - defaultSize.width()) / 2,
(screen.height() - defaultSize.height()) / 2);
parent->resize(defaultSize);
Expand Down

0 comments on commit 80b0f37

Please sign in to comment.