mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Open the new window in the screen contains the last active window.
This commit is contained in:
parent
7dbaf71f23
commit
99236b58be
|
@ -1160,6 +1160,8 @@ bool MainApplication::restoreStateSlot(QupZilla* window, RestoreData recoveryDat
|
||||||
foreach (const RestoreManager::WindowData &data, recoveryData) {
|
foreach (const RestoreManager::WindowData &data, recoveryData) {
|
||||||
QupZilla* window = makeNewWindow(Qz::BW_OtherRestoredWindow);
|
QupZilla* window = makeNewWindow(Qz::BW_OtherRestoredWindow);
|
||||||
window->restoreWindowState(data);
|
window->restoreWindowState(data);
|
||||||
|
// for correct geometry calculation in QupZilla::setupUi()
|
||||||
|
mApp->processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
destroyRestoreManager();
|
destroyRestoreManager();
|
||||||
|
|
|
@ -284,16 +284,16 @@ void QupZilla::setupUi()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Let the WM decides where to put new browser window
|
// Let the WM decides where to put new browser window
|
||||||
if (m_windowType == Qz::BW_NewWindow && mApp->getWindow()) {
|
if ((m_windowType != Qz::BW_FirstAppWindow && m_windowType != Qz::BW_MacFirstWindow) && mApp->getWindow()) {
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
// Windows WM places every new window in the middle of screen .. for some reason
|
// Windows WM places every new window in the middle of screen .. for some reason
|
||||||
QPoint p = mApp->getWindow()->geometry().topLeft();
|
QPoint p = mApp->getWindow()->geometry().topLeft();
|
||||||
p.setX(p.x() + 30);
|
p.setX(p.x() + 30);
|
||||||
p.setY(p.y() + 30);
|
p.setY(p.y() + 30);
|
||||||
|
|
||||||
if (!mApp->desktop()->availableGeometry(this).contains(p)) {
|
if (!mApp->desktop()->availableGeometry(mApp->getWindow()).contains(p)) {
|
||||||
p.setX(mApp->desktop()->availableGeometry(this).x() + 30);
|
p.setX(mApp->desktop()->availableGeometry(mApp->getWindow()).x() + 30);
|
||||||
p.setY(mApp->desktop()->availableGeometry(this).y() + 30);
|
p.setY(mApp->desktop()->availableGeometry(mApp->getWindow()).y() + 30);
|
||||||
}
|
}
|
||||||
setGeometry(QRect(p, mApp->getWindow()->size()));
|
setGeometry(QRect(p, mApp->getWindow()->size()));
|
||||||
#else
|
#else
|
||||||
|
@ -302,8 +302,8 @@ void QupZilla::setupUi()
|
||||||
}
|
}
|
||||||
else if (!restoreGeometry(settings.value("WindowGeometry").toByteArray())) {
|
else if (!restoreGeometry(settings.value("WindowGeometry").toByteArray())) {
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
setGeometry(QRect(mApp->desktop()->availableGeometry(this).x() + 30,
|
setGeometry(QRect(mApp->desktop()->availableGeometry(mApp->getWindow()).x() + 30,
|
||||||
mApp->desktop()->availableGeometry(this).y() + 30, 800, 550));
|
mApp->desktop()->availableGeometry(mApp->getWindow()).y() + 30, 800, 550));
|
||||||
#else
|
#else
|
||||||
resize(800, 550);
|
resize(800, 550);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user