make sure screen is valid before asking for i

svn path=/trunk/KDE/kdelibs/; revision=886708
This commit is contained in:
Aaron J. Seigo 2008-11-19 21:18:37 +00:00
parent 4f72717a26
commit ece148395c

View File

@ -395,11 +395,16 @@ void ToolBox::reposition()
//kDebug() << "desktop"; //kDebug() << "desktop";
int screen = d->containment->screen(); int screen = d->containment->screen();
QRectF avail = d->containment->corona()->availableScreenRegion(screen).boundingRect(); QRectF avail = d->containment->geometry();
QRectF screenGeom = d->containment->corona()->screenGeometry(screen); QRectF screenGeom = avail;
if (screen > -1 && screen < d->containment->corona()->numScreens()) {
screenGeom = d->containment->corona()->availableScreenRegion(screen).boundingRect();
screenGeom = d->containment->corona()->screenGeometry(screen);
avail.translate(-screenGeom.topLeft());
}
// Transform to the containment's coordinate system. // Transform to the containment's coordinate system.
avail.translate(-screenGeom.topLeft());
screenGeom.moveTo(0, 0); screenGeom.moveTo(0, 0);
if (!d->containment->view() || !d->containment->view()->transform().isScaling()) { if (!d->containment->view() || !d->containment->view()->transform().isScaling()) {