diff --git a/client.cpp b/client.cpp index d606ff52bf..e4c53a5e72 100644 --- a/client.cpp +++ b/client.cpp @@ -449,15 +449,16 @@ void Client::layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect padding_right + border_right, r.height() - top.height() - bottom.height()); } +QRegion Client::decorationPendingRegion() const + { + if (!paintRedirector) + return QRegion(); + return paintRedirector->pendingRegion().translated( x() - padding_left, y() - padding_top ); + } + void Client::repaintDecorationPending() { - if ( compositing() ) - { - // The scene will update the decoration pixmaps in the next painting pass - const QRegion r = paintRedirector->pendingRegion(); - Workspace::self()->addRepaint( r.translated( x() - padding_left, y() - padding_top ) ); - } - else + if (!compositing()) ensureDecorationPixmapsPainted(); } diff --git a/client.h b/client.h index 89e78731d8..dc23312979 100644 --- a/client.h +++ b/client.h @@ -336,6 +336,8 @@ class Client QRect(0, 0, width(), height()); } + QRegion decorationPendingRegion() const; + enum CoordinateMode { DecorationRelative, // Relative to the top left corner of the decoration WindowRelative // Relative to the top left corner of the window diff --git a/composite.cpp b/composite.cpp index 7193d990b2..94ca464006 100644 --- a/composite.cpp +++ b/composite.cpp @@ -414,6 +414,7 @@ void Workspace::performCompositing() // TODO I think effects->transformWindowDamage() doesn't need to be called here, // pre-paint will extend painted window areas as necessary. repaints_region |= c->repaints().translated( c->pos()); + repaints_region |= c->decorationPendingRegion(); c->resetRepaints( c->decorationRect()); } QRegion repaints = repaints_region; diff --git a/toplevel.h b/toplevel.h index 9b8f7cc9a4..19be1c436f 100644 --- a/toplevel.h +++ b/toplevel.h @@ -66,6 +66,7 @@ class Toplevel virtual QSize clientSize() const = 0; virtual QRect visibleRect() const; // the area the window occupies on the screen virtual QRect decorationRect() const; // rect including the decoration shadows + virtual QRegion decorationPendingRegion() const; // decoration region that needs to be repainted // prefer isXXX() instead // 0 for supported types means default for managed/unmanaged types @@ -251,6 +252,11 @@ inline QRect Toplevel::decorationRect() const return rect(); } +inline QRegion Toplevel::decorationPendingRegion() const + { + return QRegion(); + } + inline bool Toplevel::readyForPainting() const { return ready_for_painting;