From da76386fb009fc9933931e0973112add2e86ac2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 16 Mar 2012 12:33:48 +0100 Subject: [PATCH] Repaint Thumbnail Item on window damage Allows to have live updates for thumbnails in tabbox. BUG: 296066 FIXED-IN: 4.9.0 REVIEW: 104301 --- thumbnailitem.cpp | 8 ++++++++ thumbnailitem.h | 1 + 2 files changed, 9 insertions(+) diff --git a/thumbnailitem.cpp b/thumbnailitem.cpp index f19540591d..b402b3244b 100644 --- a/thumbnailitem.cpp +++ b/thumbnailitem.cpp @@ -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(w)->window()->window() == m_wId) { + update(); + } +} + } // namespace KWin diff --git a/thumbnailitem.h b/thumbnailitem.h index 8d39f5fc26..e50c973539 100644 --- a/thumbnailitem.h +++ b/thumbnailitem.h @@ -54,6 +54,7 @@ Q_SIGNALS: private Q_SLOTS: void init(); void effectWindowAdded(); + void repaint(KWin::EffectWindow* w); private: void findParentEffectWindow(); qulonglong m_wId;