set the screens to -1 for both containments before switching them, it

avoids a screenownerchanged infinite loop

svn path=/trunk/KDE/kdelibs/; revision=952429
This commit is contained in:
Marco Martin 2009-04-11 21:12:03 +00:00
parent 05828b7b81
commit baf9e2bffe
2 changed files with 5 additions and 1 deletions

View File

@ -794,7 +794,7 @@ void Containment::setScreen(int newScreen, int newDesktop)
newDesktop = -1;
}
kDebug() << "setting screen to " << newScreen << newDesktop << "and type is" << d->type;
kDebug() << activity() << "setting screen to " << newScreen << newDesktop << "and type is" << d->type;
Containment *swapScreensWith(0);
if (d->type == DesktopContainment || d->type >= CustomContainment) {

View File

@ -245,9 +245,12 @@ void View::setContainment(Plasma::Containment *containment)
int otherScreen = containment->screen();
int otherDesktop = containment->desktop();
if (screen > -1) {
d->lastScreen = screen;
d->lastDesktop = desktop;
oldContainment->setScreen(-1, -1);
containment->setScreen(-1, -1);
containment->setScreen(screen, desktop);
} else {
d->lastScreen = otherScreen;
@ -259,6 +262,7 @@ void View::setContainment(Plasma::Containment *containment)
oldContainment->setScreen(otherScreen, otherDesktop);
}
/*
if (oldContainment) {
kDebug() << "old" << (QObject*)oldContainment << screen << oldContainment->screen()