diff --git a/applet.cpp b/applet.cpp index 2b557bb80..b78153e95 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1799,7 +1799,6 @@ bool Applet::sceneEventFilter(QGraphicsItem *watched, QEvent *event) break; } - return false; } switch (event->type()) { @@ -2409,11 +2408,15 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value) break; case ItemParentHasChanged: { - Containment *c = containment(); - if (c && c->containmentType() == Containment::DesktopContainment) { - installSceneEventFilter(this); - } else { + if (isContainment()) { removeSceneEventFilter(this); + } else { + Containment *c = containment(); + if (c && c->containmentType() == Containment::DesktopContainment) { + installSceneEventFilter(this); + } else { + removeSceneEventFilter(this); + } } } break;