diff options
author | Sam Spilsbury <sam.spilsbury@canonical.com> | 2011-02-12 13:20:55 +0800 |
---|---|---|
committer | Sam Spilsbury <sam.spilsbury@canonical.com> | 2011-02-12 13:20:55 +0800 |
commit | cdc41289dc45c1e1c819fd34ec94ea5e42120615 (patch) | |
tree | b4886115211bbed8b8862e1479837c2b5ff251d2 | |
parent | 63d77b72a58a96ecc682d23b48e0c2f8e811efbf (diff) | |
download | compiz-with-glib-mainloop-cdc41289dc45c1e1c819fd34ec94ea5e42120615.tar.gz compiz-with-glib-mainloop-cdc41289dc45c1e1c819fd34ec94ea5e42120615.tar.bz2 |
Fix artefacts in shadow clipping.
Intersect the clip region already computed by core with the output
region of the window so that we don't display parts of the window that
might be occluded
-rw-r--r-- | plugins/decor/src/decor.cpp | 14 | ||||
-rw-r--r-- | plugins/decor/src/decor.h | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/plugins/decor/src/decor.cpp b/plugins/decor/src/decor.cpp index ccd9561..fc16b39 100644 --- a/plugins/decor/src/decor.cpp +++ b/plugins/decor/src/decor.cpp @@ -68,11 +68,19 @@ isAncestorTo (CompWindow *window, * another menu is adjacent and covering the shadow * region. Also panel shadows are nice, but not * when they obscure client window shadows + * + * We need to use the current clip region here + * and take an intersection of that to ensure + * that we don't unintentionally expand the clip + * region that core already reduced by doing + * occlusion detection */ CompRegion -DecorWindow::computeClipRegion () +DecorWindow::computeClipRegion (const CompRegion &clip) { - CompRegion reg (window->outputRect ()); + CompRegion reg; + + reg = CompRegion (window->outputRect ()).intersected (clip); if (window->type () == CompWindowTypeDockMask) { @@ -175,7 +183,7 @@ DecorWindow::glDraw (const GLMatrix &transform, status = gWindow->glDraw (transform, attrib, region, mask); const CompRegion reg = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? - infiniteRegion : computeClipRegion (); + infiniteRegion : computeClipRegion (region); if (wd && !reg.isEmpty () && wd->decor->type == WINDOW_DECORATION_TYPE_PIXMAP) diff --git a/plugins/decor/src/decor.h b/plugins/decor/src/decor.h index 88d2c93..e3131f3 100644 --- a/plugins/decor/src/decor.h +++ b/plugins/decor/src/decor.h @@ -178,7 +178,7 @@ class DecorWindow : bool damageRect (bool, const CompRect &); - CompRegion computeClipRegion (); + CompRegion computeClipRegion (const CompRegion &); bool glDraw (const GLMatrix &, GLFragment::Attrib &, const CompRegion &, unsigned int); |