From ecfd06cfe925592580192cea04194ecec5f787a6 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Thu, 2 Jan 2014 21:09:45 +0200 Subject: [PATCH] Ensure that the options window will always be placed onscreen. Closes #1226. --- src/preferences/options_imp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/preferences/options_imp.cpp b/src/preferences/options_imp.cpp index ef28b51e4..51d6be48a 100755 --- a/src/preferences/options_imp.cpp +++ b/src/preferences/options_imp.cpp @@ -256,8 +256,8 @@ options_imp::options_imp(QWidget *parent): connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton())); // Adapt size - show(); loadWindowState(); + show(); } void options_imp::initializeLanguageCombo() @@ -294,7 +294,8 @@ void options_imp::loadWindowState() { QIniSettings settings; resize(settings.value(QString::fromUtf8("Preferences/State/size"), sizeFittingScreen()).toSize()); QPoint p = settings.value(QString::fromUtf8("Preferences/State/pos"), QPoint()).toPoint(); - if (!p.isNull()) + QRect scr_rect = qApp->desktop()->screenGeometry(); + if (!p.isNull() && scr_rect.contains(p)) move(p); // Load slider size const QStringList sizes_str = settings.value("Preferences/State/hSplitterSizes", QStringList()).toStringList();