diff options
| author | Silarn <jrim@rimpo.org> | 2019-07-03 14:12:38 -0500 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-07-03 14:12:38 -0500 |
| commit | 3a2f056e8adf07f31ea1f6b2856a6d57da1f4777 (patch) | |
| tree | 4fbb79a7cd7304ab8c4aedfba1de8964ea29d860 /src/main.cpp | |
| parent | aa9a1fc07fb612547c1d1c5074d669b2dd258af9 (diff) | |
More refactoring
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index b83e581b..1e60483f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -645,10 +645,13 @@ int runApplication(MOApplication &application, SingleInstance &instance, if (settings.contains("window_monitor")) { const int monitor = settings.value("window_monitor").toInt(); - if (monitor != -1) { + if (monitor != -1 && QGuiApplication::screens().size() > monitor) { QGuiApplication::screens().at(monitor)->geometry().center(); const QPoint center = QGuiApplication::screens().at(monitor)->geometry().center(); splash.move(center - splash.rect().center()); + } else { + const QPoint center = QGuiApplication::primaryScreen()->geometry().center(); + splash.move(center - splash.rect().center()); } } |
