diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index d2def2c..54bf745 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,7 @@ #include <QTranslator> #include <QCommandLineParser> #include <QScreen> +#include <QDesktopWidget> namespace { bool _testMode, _autoSetup, _showGui, _backgroundMode, _wakeup, _center, _dumpScreens; @@ -199,6 +200,13 @@ static void dumpScreens() qSort(list.begin(), list.end(), [](const QRect &one, const QRect &other) -> bool { return one.y() < other.y() || (one.y() == other.y() && one.x() < other.x()); }); + if (list.empty()) { + // Fallback to desktop size + QRect s = qApp->desktop()->screenGeometry(); + if (s.width() > 0 && s.height() > 0) { + list.append(s); + } + } int nextX = 0; int lastY = 0; qStdOut() << "# x y width height" << endl; |