backport revision 931126

Fix bug 184930.
The containment's screen can change after it is initially created, so make sure
it is changed in the view as well.

svn path=/branches/KDE/4.2/kdelibs/; revision=931127
This commit is contained in:
Ambroz Bizjak 2009-02-24 20:31:25 +00:00
parent 59896b6e95
commit 334a27933d
2 changed files with 9 additions and 0 deletions

View File

@ -86,6 +86,12 @@ public:
containment = 0;
}
void containmentScreenChanged(int wasScreen, int newScreen, Plasma::Containment *containment)
{
lastScreen = newScreen;
lastDesktop = this->containment->desktop();
}
void initGraphicsView()
{
q->setFrameShape(QFrame::NoFrame);
@ -196,6 +202,7 @@ void View::setContainment(Plasma::Containment *containment)
if (d->containment) {
disconnect(d->containment, SIGNAL(destroyed(QObject*)), this, SLOT(containmentDestroyed()));
disconnect(d->containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect()));
disconnect(d->containment, SIGNAL(screenChanged(int, int, Plasma::Containment *)), this, SLOT(containmentScreenChanged(int, int, Plasma::Containment *)));
d->containment->removeAssociatedWidget(this);
}
@ -247,6 +254,7 @@ void View::setContainment(Plasma::Containment *containment)
d->updateSceneRect();
connect(containment, SIGNAL(destroyed(QObject*)), this, SLOT(containmentDestroyed()));
connect(containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect()));
connect(containment, SIGNAL(screenChanged(int, int, Plasma::Containment *)), this, SLOT(containmentScreenChanged(int, int, Plasma::Containment *)));
}
Containment *View::containment() const

1
view.h
View File

@ -197,6 +197,7 @@ private:
Q_PRIVATE_SLOT(d, void updateSceneRect())
Q_PRIVATE_SLOT(d, void containmentDestroyed())
Q_PRIVATE_SLOT(d, void containmentScreenChanged(int, int, Plasma::Containment *))
friend class ViewPrivate;
};