make sure there is any screen geometry returned

if the heuristic fails (because the topleft of the dialog is offscreen)
use at least our screen()

the screen should be correctly updated now on Qt 5.3+ so should be
more reliable anyways (could be tried to remove the whole Q_FOREACH
at this point)

Change-Id: I29311f4767bde3e02ae7bcb54b400b72a8f190eb
This commit is contained in:
Marco Martin 2014-10-24 12:33:29 +02:00
parent 8d2aa05530
commit 2b07624173

View File

@ -159,6 +159,17 @@ QRect DialogPrivate::availableScreenGeometryForPosition(const QPoint& pos) const
}
}
/*
* if the heuristic fails (because the topleft of the dialog is offscreen)
* use at least our screen()
* the screen should be correctly updated now on Qt 5.3+ so should be
* more reliable anyways (could be tried to remove the whole Q_FOREACH
* at this point)
*/
if (avail.isEmpty()) {
avail = q->screen()->availableGeometry();
}
return avail;
}