diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-03 14:51:12 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-03 14:51:12 -0400 |
| commit | 24aee49792c149f080eee37171ba049d0a618961 (patch) | |
| tree | 0f7ad55cde964da2afd3453b2d1a751e1ab2a462 /src/main.cpp | |
| parent | f00314442b9c3c28e846c64da3c3f776e50656de (diff) | |
remember the monitor number
use it to display the splash screen on the same monitor as the main window instead of where the mouse cursor is
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index c012b037..6f304944 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -597,6 +597,17 @@ int runApplication(MOApplication &application, SingleInstance &instance, QPixmap pixmap(splashPath); QSplashScreen splash(pixmap); + + 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(); + splash.move(center - splash.rect().center()); + } + } + splash.show(); splash.activateWindow(); |
