summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2010-12-11 18:40:34 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2010-12-11 18:40:34 +0800
commitab1428e9b0b6a9de8a005ab261147a6990993a07 (patch)
treedd4266703a2594e1aea82c49a3007ebda1058638
parent52f5c3eba23f258008d77e8c71e22ece14b3c2a0 (diff)
downloadcompiz-with-glib-mainloop-ab1428e9b0b6a9de8a005ab261147a6990993a07.tar.gz
compiz-with-glib-mainloop-ab1428e9b0b6a9de8a005ab261147a6990993a07.tar.bz2
Ensure decoration is updated on shade. Fixes artifacts.
Previously we'd rely upon a change in winDecorAtom to tell us when to update the decoration, however now that we are reparenting we can't do that anymore so hook windowNotify to watch for shade and unshade and then force the decoration to be updated on resizeNotify if this is the case.
-rw-r--r--plugins/decor/src/decor.cpp34
-rw-r--r--plugins/decor/src/decor.h3
2 files changed, 33 insertions, 4 deletions
diff --git a/plugins/decor/src/decor.cpp b/plugins/decor/src/decor.cpp
index 511d99b..1c5b2cd 100644
--- a/plugins/decor/src/decor.cpp
+++ b/plugins/decor/src/decor.cpp
@@ -1247,10 +1247,28 @@ DecorWindow::updateWindowRegions ()
void
DecorWindow::windowNotify (CompWindowNotify n)
{
- if (n == CompWindowNotifyReparent)
+ switch (n)
{
- DecorWindow::get (window)->update (true);
- window->windowNotifySetEnabled (this, false);
+ case CompWindowNotifyReparent:
+ update (true);
+ /* We get the notification for shade before the window is
+ * actually resized which means that calling update ->
+ * damageOutputExtents here will not do anything useful for us
+ * so we need to track when windows are (un)shading and then wait
+ * for the following resize notification to actually
+ * update their decoration (since at this point they would have
+ * been resized)
+ */
+ case CompWindowNotifyShade:
+ shading = true;
+ unshading = false;
+ break;
+ case CompWindowNotifyUnshade:
+ unshading = true;
+ shading = false;
+ break;
+ default:
+ break;
}
window->windowNotify (n);
@@ -1625,6 +1643,13 @@ DecorWindow::moveNotify (int dx, int dy, bool immediate)
bool
DecorWindow::resizeTimeout ()
{
+ if (shading || unshading)
+ {
+ shading = false;
+ unshading = false;
+
+ updateDecoration ();
+ }
update (true);
return false;
}
@@ -1778,7 +1803,8 @@ DecorWindow::DecorWindow (CompWindow *w) :
outputFrame (None),
pixmapFailed (false),
regions (),
- updateReg (true)
+ updateReg (true),
+ unshading (false)
{
WindowInterface::setHandler (window);
diff --git a/plugins/decor/src/decor.h b/plugins/decor/src/decor.h
index 9545807..f382639 100644
--- a/plugins/decor/src/decor.h
+++ b/plugins/decor/src/decor.h
@@ -228,6 +228,9 @@ class DecorWindow :
CompTimer resizeUpdate;
CompTimer moveUpdate;
+
+ bool unshading;
+ bool shading;
};
class DecorPluginVTable :