diff --git a/corona.h b/corona.h index cc54d3b85..e6d36b82a 100644 --- a/corona.h +++ b/corona.h @@ -432,6 +432,7 @@ private: Q_PRIVATE_SLOT(d, void showShortcutConfig()) friend class CoronaPrivate; + friend class View; }; } // namespace Plasma diff --git a/view.cpp b/view.cpp index 1806ab5eb..86e4cf2d1 100644 --- a/view.cpp +++ b/view.cpp @@ -312,8 +312,10 @@ Containment *View::swapContainment(Plasma::Containment *existing, const QString Containment *old = existing; Plasma::Corona *corona = old->corona(); - Plasma::Containment *c = corona->addContainment(name, args); + Plasma::Containment *c = corona->addContainmentDelayed(name, args); if (c) { + c->init(); + KConfigGroup oldConfig = old->config(); KConfigGroup newConfig = c->config(); @@ -330,6 +332,9 @@ Containment *View::swapContainment(Plasma::Containment *existing, const QString // load the configuration of the old containment into the new one c->restore(newConfig); + c->updateConstraints(Plasma::StartupCompletedConstraint); + c->flushPendingConstraintsEvents(); + emit corona->containmentAdded(c); foreach (Applet *applet, c->applets()) { applet->init(); // We have to flush the applet constraints manually