fix screen region mapping

BUG:334670
This commit is contained in:
Marco Martin 2014-05-13 13:42:44 +02:00
parent 55514d28c7
commit 34b86471d0

View File

@ -177,8 +177,8 @@ QVariantList ContainmentInterface::availableScreenRegion() const
QVariantList regVal;
foreach (QRect rect, reg.rects()) {
//make it relative
rect.setX(rect.x() - containment()->corona()->screenGeometry(containment()->screen()).x());
rect.setY(rect.y() - containment()->corona()->screenGeometry(containment()->screen()).y());
rect.moveTo(rect.x() - containment()->corona()->screenGeometry(containment()->screen()).x(),
rect.y() - containment()->corona()->screenGeometry(containment()->screen()).y());
regVal << QVariant::fromValue(QRectF(rect));
}
return regVal;
@ -191,8 +191,8 @@ QRect ContainmentInterface::availableScreenRect() const
if (containment()->screen() > -1 && containment()->corona()) {
rect = containment()->corona()->availableScreenRect(containment()->screen());
//make it relative
rect.setX(rect.x() - containment()->corona()->screenGeometry(containment()->screen()).x());
rect.setY(rect.y() - containment()->corona()->screenGeometry(containment()->screen()).y());
rect.moveTo(rect.x() - containment()->corona()->screenGeometry(containment()->screen()).x(),
rect.y() - containment()->corona()->screenGeometry(containment()->screen()).y());
}
return rect;