changeset 297:ec08830e362e

* Avoid using last window placement if it is off-screen
author Chris Cannam
date Tue, 20 Jan 2009 18:12:40 +0000 (2009-01-20)
parents 5c5a1ce79ad5
children 7872a95ee530
files main/main.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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();