Repaint Thumbnail Item on window damage

Allows to have live updates for thumbnails in tabbox.
BUG: 296066
FIXED-IN: 4.9.0
REVIEW: 104301
This commit is contained in:
Martin Gräßlin 2012-03-16 12:33:48 +01:00
parent 40970a32f1
commit da76386fb0
2 changed files with 9 additions and 0 deletions

View file

@ -41,6 +41,7 @@ ThumbnailItem::ThumbnailItem(QDeclarativeItem* parent)
setFlags(flags() & ~QGraphicsItem::ItemHasNoContents);
if (effects) {
connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), SLOT(effectWindowAdded()));
connect(effects, SIGNAL(windowDamaged(KWin::EffectWindow*,QRect)), SLOT(repaint(KWin::EffectWindow*)));
}
QTimer::singleShot(0, this, SLOT(init()));
}
@ -117,4 +118,11 @@ void ThumbnailItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
pixmap);
}
void ThumbnailItem::repaint(KWin::EffectWindow *w)
{
if (static_cast<KWin::EffectWindowImpl*>(w)->window()->window() == m_wId) {
update();
}
}
} // namespace KWin

View file

@ -54,6 +54,7 @@ Q_SIGNALS:
private Q_SLOTS:
void init();
void effectWindowAdded();
void repaint(KWin::EffectWindow* w);
private:
void findParentEffectWindow();
qulonglong m_wId;