diff main/main.cpp @ 297:ec08830e362e

* Avoid using last window placement if it is off-screen
author Chris Cannam
date Tue, 20 Jan 2009 18:12:40 +0000
parents 5c5a1ce79ad5
children 7872a95ee530
line wrap: on
line diff
--- a/main/main.cpp	Fri Jan 09 14:55:12 2009 +0000
+++ b/main/main.cpp	Tue Jan 20 18:12:40 2009 +0000
@@ -315,7 +315,10 @@
     QSize size = settings.value("size", QSize(width, height)).toSize();
     gui->resize(size);
     if (settings.contains("position")) {
-        gui->move(settings.value("position").toPoint());
+        QRect prevrect(settings.value("position").toPoint(), size);
+        if (!(available & prevrect).isEmpty()) {
+            gui->move(prevrect.topLeft());
+        }
     }
     settings.endGroup();