summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4359c645..bf4e5b97 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -666,9 +666,12 @@ int runApplication(MOApplication &application, SingleInstance &instance,
if (settings.contains("window_monitor")) {
const int monitor = settings.value("window_monitor").toInt();
- if (monitor != -1) {
- QDesktopWidget* desktop = QApplication::desktop();
- const QPoint center = desktop->availableGeometry(monitor).center();
+ 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());
}
}