ask for the screen of the view, even if it doesn't have a containment

svn path=/trunk/KDE/kdelibs/; revision=1042437
This commit is contained in:
Marco Martin 2009-10-29 19:53:03 +00:00
parent 895d230262
commit df6032f5ef

View File

@ -662,8 +662,14 @@ QPoint Corona::popupPosition(const QGraphicsItem *item, const QSize &s, Qt::Alig
}
//are we out of screen?
QRect screenRect = screenGeometry(pv ? pv->screen() : -1);
//kDebug() << "==> rect for" << (pv ? pv->containment()->screen() : -1) << "is" << screenRect;
int screen = ((pv && pv->containment()) ? pv->containment()->screen() : -1);
if (pv && screen == -1) {
screen = pv->screen();
}
QRect screenRect = screenGeometry(screen);
//kDebug() << "==> rect for" << screen << "is" << screenRect;
if (loc != LeftEdge && pos.x() + s.width() > screenRect.right()) {
pos.rx() -= ((pos.x() + s.width()) - screenRect.right());