From 258f9d77aa194b330c244563d08b4ac7e3f18bbf Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Tue, 4 May 2021 22:53:12 +0200 Subject: [PATCH] Fix window position restore. Ref #220 --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 2172a1c..65e771f 100644 --- a/main.cpp +++ b/main.cpp @@ -235,9 +235,9 @@ int main(int argc, char *argv[]) if (x != -1 && y != -1) { - if ( (screensize.width()-x) < w || (screensize.height()-y) < h) + if ( !app.screenAt(QPoint(x,y)) || !app.screenAt(QPoint(x+w,y+h)) ) { - qDebug() << "Not restoring saved window position as it falls outside of primary screen"; + qDebug() << "Not restoring saved window position as it falls outside any currently attached screen"; x = y = -1; } }