diff --git a/applet.cpp b/applet.cpp index 0e06a1561..98d26a737 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1655,7 +1655,9 @@ QString AppletPrivate::instanceName() void AppletPrivate::scheduleConstraintsUpdate(Plasma::Constraints c) { - if (!constraintsTimerId) { + // Don't start up a timer if we're just starting up + // flushPendingConstraints will be called by Corona + if (!constraintsTimerId && !(c & Plasma::StartupCompletedConstraint)) { constraintsTimerId = q->startTimer(0); } pendingConstraints |= c; diff --git a/containment.h b/containment.h index 7e289998c..fab6a069d 100644 --- a/containment.h +++ b/containment.h @@ -176,7 +176,12 @@ class PLASMA_EXPORT Containment : public Applet const QRectF &geometry = QRectF(-1, -1, -1, -1)); /** - * add existing applet to this containment at pos + * Add an existing applet to this Containment + * + * If dontInit is true, the pending constraints are not flushed either. + * So it is your responsibility to call both init() and + * flushPendingConstraints() on the applet. + * * @param applet the applet that should be added * @param pos the containment-relative position * @param dontInit if true, init() will not be called on the applet diff --git a/corona.cpp b/corona.cpp index 4660e7d3d..b0b1a5f92 100644 --- a/corona.cpp +++ b/corona.cpp @@ -289,6 +289,8 @@ void Corona::loadLayout(const QString& configName) foreach(Applet* applet, containment->applets()) { applet->init(); + // We have to flush the applet constraints manually + applet->flushPendingConstraintsEvents(); } containment->updateConstraints(Plasma::StartupCompletedConstraint);