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