theory: the desktop breakage could happen because the panel overlaps the

desktop for a while, making containment()->view() or
corona::containmentfordesktop() fails, leaving the desktop view without
a containment
try to reposition the panel before a vertical movement, it should
prevent the panel to go into the desktop for an instant
CCBUG:176280

svn path=/trunk/KDE/kdelibs/; revision=927141
This commit is contained in:
Marco Martin 2009-02-16 21:45:18 +00:00
parent f9ab759b8e
commit 59a0e9f0e8

View File

@ -1177,20 +1177,26 @@ QVariant Containment::itemChange(GraphicsItemChange change, const QVariant &valu
{
//FIXME if the applet is moved to another containment we need to unfocus it
QVariant newValue = Applet::itemChange(change, value);
if (isContainment() && !ContainmentPrivate::s_positioning &&
(change == QGraphicsItem::ItemSceneHasChanged || change == QGraphicsItem::ItemPositionHasChanged)) {
switch (d->type) {
case PanelContainment:
case CustomPanelContainment:
d->positionPanel();
break;
default:
d->positionContainments();
break;
(change == QGraphicsItem::ItemSceneChange || change == QGraphicsItem::ItemPositionChange)) {
//if the position will be actually changed, reposition before the change
if (newValue == value) {
switch (d->type) {
case PanelContainment:
case CustomPanelContainment:
d->positionPanel();
break;
default:
d->positionContainments();
break;
}
}
}
return Applet::itemChange(change, value);
return newValue;
}
void Containment::enableAction(const QString &name, bool enable)