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:
parent
40970a32f1
commit
da76386fb0
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -54,6 +54,7 @@ Q_SIGNALS:
|
|||
private Q_SLOTS:
|
||||
void init();
|
||||
void effectWindowAdded();
|
||||
void repaint(KWin::EffectWindow* w);
|
||||
private:
|
||||
void findParentEffectWindow();
|
||||
qulonglong m_wId;
|
||||
|
|
Loading…
Reference in a new issue