1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-25 01:02:37 +01:00

Merge pull request #5124 from TheUbuntuGuy/mmonfix

Respawn mainwindow on correct monitor
This commit is contained in:
John Maguire 2015-11-22 11:42:00 +00:00
commit 4393f7e53f

View File

@ -903,12 +903,11 @@ MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd,
qLog(Debug) << "Loading settings"; qLog(Debug) << "Loading settings";
settings_.beginGroup(kSettingsGroup); settings_.beginGroup(kSettingsGroup);
// Set window Geometry if the window was closed in normal mode // Set last used geometry to position window on the correct monitor
// else set it to window maximized // Set window state only if the window was last maximized
was_maximized_ = settings_.value("maximized", false).toBool(); was_maximized_ = settings_.value("maximized", false).toBool();
if (!was_maximized_) {
restoreGeometry(settings_.value("geometry").toByteArray()); restoreGeometry(settings_.value("geometry").toByteArray());
} else { if (was_maximized_) {
setWindowState(windowState() | Qt::WindowMaximized); setWindowState(windowState() | Qt::WindowMaximized);
} }