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; 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); Containment *swapScreensWith(0);
if (d->type == DesktopContainment || d->type >= CustomContainment) { if (d->type == DesktopContainment || d->type >= CustomContainment) {

View File

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