prevent panels from encroaching into positive space and screwing things up: constraintsEvent is delayed, and that event loop is entered between. this is something that needs to be done synchronously, however. SizeConstraint is triggered by Applet::resizeEvent, so putting this code in resizeEvent is no more or less immune to applets/containments reimplementing resizeEvent and not calling the base implementation.

BUG:176280

svn path=/trunk/KDE/kdelibs/; revision=928671
This commit is contained in:
Aaron J. Seigo 2009-02-19 19:50:19 +00:00
parent 1f6e98c957
commit 9f40f63081

View File

@ -1080,6 +1080,19 @@ const QGraphicsItem *Containment::toolBoxItem() const
void Containment::resizeEvent(QGraphicsSceneResizeEvent *event)
{
Applet::resizeEvent(event);
if (!ContainmentPrivate::s_positioning) {
switch (d->type) {
case Containment::PanelContainment:
case Containment::CustomPanelContainment:
d->positionPanel();
break;
default:
d->positionContainments();
break;
}
}
if (d->wallpaper) {
d->wallpaper->setBoundingRect(boundingRect());
}
@ -1652,18 +1665,6 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
}
}
if (constraints & Plasma::SizeConstraint && !ContainmentPrivate::s_positioning) {
switch (type) {
case Containment::PanelContainment:
case Containment::CustomPanelContainment:
positionPanel();
break;
default:
positionContainments();
break;
}
}
if (toolBox && (constraints & Plasma::SizeConstraint ||
constraints & Plasma::FormFactorConstraint ||
constraints & Plasma::ScreenConstraint ||
@ -1841,6 +1842,7 @@ void ContainmentPrivate::positionPanel(bool force)
// we position panels in negative coordinates, and stack all horizontal
// and all vertical panels with each other.
const QPointF p = q->pos();
if (!force &&