diff --git a/applet.cpp b/applet.cpp index 34025cc87..499a3a126 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2102,19 +2102,6 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value) delete old; } } - - Plasma::PopupApplet *pa = qobject_cast(this); - if (pa) { - //reconnect of popupapplets with new containment geometryChanged - if (c) { - disconnect(containment(), SIGNAL(geometryChanged()), pa, SLOT(updateDialogPosition())); - } - - Plasma::Containment *cont = dynamic_cast(value.value()); - if (cont) { - connect(cont, SIGNAL(geometryChanged()), pa, SLOT(updateDialogPosition())); - } - } } break; case ItemPositionChange: diff --git a/plasma.h b/plasma.h index 25e007760..8cb8633ec 100644 --- a/plasma.h +++ b/plasma.h @@ -56,9 +56,11 @@ enum Constraint { /** application startup has completed */ StartupCompletedConstraint = 32, /** the desktop context has changed */ - ContextConstraint = 64, + ContextConstraint = 64, + /** the position of the popup needs to be recalculated*/ + PopupConstraint = 128, AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | - SizeConstraint | ImmutableConstraint | ContextConstraint + SizeConstraint | ImmutableConstraint | ContextConstraint | PopupConstraint }; Q_DECLARE_FLAGS(Constraints, Constraint) diff --git a/popupapplet.cpp b/popupapplet.cpp index 8fd751fb0..48b57c95f 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -342,6 +342,11 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) q->setMinimumSize(0,0); } } + + if (dialog && constraints & Plasma::PopupConstraint) { + updateDialogPosition(); + } + emit q->sizeHintChanged(Qt::PreferredSize); } diff --git a/view.cpp b/view.cpp index 9dd157e84..ce3c791ec 100644 --- a/view.cpp +++ b/view.cpp @@ -350,6 +350,7 @@ void View::configNeedsSaving() const } } + int View::id() const { return d->viewId;