From d5ce775e22ae0e43d9b6f847854017817d69ca7b Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 1 Jun 2009 17:30:52 +0000 Subject: [PATCH] save the desktop setting when it changes in setScreen just as we do for the screen CCBUG:192245 svn path=/trunk/KDE/kdelibs/; revision=976441 --- containment.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/containment.cpp b/containment.cpp index 518163581..1386fc28b 100644 --- a/containment.cpp +++ b/containment.cpp @@ -295,6 +295,7 @@ void Containment::restore(KConfigGroup &group) setLocation((Plasma::Location)group.readEntry("location", (int)d->location)); setFormFactor((Plasma::FormFactor)group.readEntry("formfactor", (int)d->formFactor)); + //kDebug() << "setScreen from restore"; setScreen(group.readEntry("screen", d->screen), group.readEntry("desktop", d->desktop)); setActivity(group.readEntry("activity", QString())); @@ -843,7 +844,7 @@ void Containment::setScreen(int newScreen, int newDesktop) newDesktop = -1; } - kDebug() << activity() << "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) { @@ -862,6 +863,7 @@ void Containment::setScreen(int newScreen, int newDesktop) << "desktop" << currently->desktop() << "and is" << currently->activity() << (QObject*)currently << "i'm" << (QObject*)this; + //kDebug() << "setScreen due to swap"; currently->setScreen(-1, newDesktop); swapScreensWith = currently; } @@ -883,15 +885,19 @@ void Containment::setScreen(int newScreen, int newDesktop) updateConstraints(Plasma::ScreenConstraint); - if (oldScreen != newScreen) { - emit screenChanged(oldScreen, newScreen, this); + if (oldScreen != newScreen || oldDesktop != newDesktop) { + if (oldScreen != newScreen) { + emit screenChanged(oldScreen, newScreen, this); + } KConfigGroup c = config(); c.writeEntry("screen", d->screen); + c.writeEntry("desktop", d->desktop); emit configNeedsSaving(); } if (swapScreensWith) { + //kDebug() << "setScreen due to swap, part 2"; swapScreensWith->setScreen(oldScreen, oldDesktop); }