diff --git a/applet.cpp b/applet.cpp index e150dd748..393dd3833 100644 --- a/applet.cpp +++ b/applet.cpp @@ -645,7 +645,8 @@ bool Applet::isKioskImmutable() const void Applet::setImmutable(bool immutable) { - if (d->immutable == immutable) { + if (d->immutable == immutable || + (immutable && d->kioskImmutable)) { return; } @@ -766,8 +767,11 @@ void Applet::checkImmutability() { d->kioskImmutable = globalConfig().isImmutable() || config().isImmutable() || (containment() && containment()->isKioskImmutable()) || - (dynamic_cast( scene() ) && static_cast(scene())->isKioskImmutable()); - setImmutable(d->kioskImmutable); + (dynamic_cast(scene()) && static_cast(scene())->isKioskImmutable()); + + if (d->kioskImmutable) { + updateConstraints(ImmutableConstraint); + } } void Applet::flushUpdatedConstraints() diff --git a/corona.cpp b/corona.cpp index b5b413c2f..c60dd7ef0 100644 --- a/corona.cpp +++ b/corona.cpp @@ -90,6 +90,15 @@ public: } } + void updateContainmentImmutability() + { + foreach (Containment *c, containments) { + // we need to tell each containment that immutability has been altered + // TODO: should we tell the applets too? + c->updateConstraints(ImmutableConstraint); + } + } + bool immutable; bool kioskImmutable; QString mimetype; @@ -274,6 +283,10 @@ void Corona::loadApplets(const QString& configName) } d->kioskImmutable = config()->isImmutable(); + if (d->kioskImmutable) { + d->updateContainmentImmutability(); + } + KConfigGroup coronaConfig(config(), "General"); setImmutable(coronaConfig.readEntry("locked", false)); } @@ -521,17 +534,14 @@ bool Corona::isKioskImmutable() const void Corona::setImmutable(bool immutable) { - if (d->immutable == immutable) { + if (d->immutable == immutable || + (!immutable && d->kioskImmutable)) { return; } kDebug() << "setting immutability to" << immutable; d->immutable = immutable; - foreach (Containment *c, d->containments) { - // we need to tell each containment that immutability has been altered - // TODO: should we tell the applets too? - c->updateConstraints(ImmutableConstraint); - } + d->updateContainmentImmutability(); } } // namespace Plasma