if we don't have a PlasmaView, then ask QDesktopWidget which screen it thinks we are tipping on

BUG:241278

svn path=/trunk/KDE/kdelibs/; revision=1137109
This commit is contained in:
Aaron J. Seigo 2010-06-11 17:20:29 +00:00
parent 6300946727
commit e07a9c88bb

View File

@ -23,6 +23,7 @@
#include "corona.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QGraphicsView>
#include <QGraphicsSceneDragDropEvent>
#include <QGraphicsGridLayout>
@ -765,8 +766,14 @@ QPoint Corona::popupPosition(const QGraphicsItem *item, const QSize &s, Qt::Alig
//are we out of screen?
int screen = ((pv && pv->containment()) ? pv->containment()->screen() : -1);
if (pv && screen == -1) {
if (screen == -1) {
if (pv) {
screen = pv->screen();
} else {
// fall back to asking the actual system what screen the view is on
// in the case we are dealing with a non-PlasmaView QGraphicsView
screen = QApplication::desktop()->screenNumber(v);
}
}
QRect screenRect = screenGeometry(screen);