Fix for issues with startup and multiple monitors on windows.
This commit is contained in:
parent
f93f9b9296
commit
e9ff818b69
1 changed files with 9 additions and 6 deletions
|
@ -843,14 +843,17 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize,
|
||||||
QPoint pos = settings.value(strSetting + "Pos").toPoint();
|
QPoint pos = settings.value(strSetting + "Pos").toPoint();
|
||||||
QSize size = settings.value(strSetting + "Size", defaultSize).toSize();
|
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->resize(size);
|
||||||
parent->move(pos);
|
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)
|
void setClipboard(const QString& str)
|
||||||
|
|
Loading…
Reference in a new issue