summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 77c4932..c513282 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -158,6 +158,7 @@ void setupScreens()
{
// Get a list of non-overlapping screens, as this might lead to a broken
// greeter with main windows covering other login forms
+ qDebug() << "Reposistioning greeter";
QMap<int, QRect> screens;
QList<QRect> allNew;
if (Global::testMode()) {
@@ -165,6 +166,9 @@ void setupScreens()
} else {
for (int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
QRect r = QApplication::desktop()->screenGeometry(i);
+ if (r.width() < 200 || r.height() < 200)
+ continue; // Sanity check
+ qDebug() << "Have screen" << r;
allNew.append(r);
QMutableMapIterator<int, QRect>it(screens);
while (it.hasNext()) {
@@ -184,6 +188,15 @@ void setupScreens()
skip_rect: ; // Do nothing
}
}
+ if (screens.isEmpty()) {
+ // Huh?
+ QRect r = QApplication::desktop()->geometry();
+ r.setTopLeft(QPoint(0, 0));
+ r = r.united(QRect(0, 0, 640, 480));
+ qDebug() << "No screens found, adding fake screen" << r;
+ screens.insert(0, r);
+ allNew.insert(0, r);
+ }
// Spurious event?
int primaryNew = QApplication::desktop()->primaryScreen();