summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-02-21 13:48:19 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-02-21 13:48:19 +0800
commit881e8de7b46f5977735dbf908e83604bc45a1630 (patch)
tree4a987184ee0587d168827abd8cb7148c4cb2a492
parent9d84472b0419d908ad62f6b28a47e2f188d9f6fb (diff)
downloadcompiz-with-glib-mainloop-881e8de7b46f5977735dbf908e83604bc45a1630.tar.gz
compiz-with-glib-mainloop-881e8de7b46f5977735dbf908e83604bc45a1630.tar.bz2
Fix 2D Mode.
Don't refresh shadow info (and check windows in paint list) if compositing is not active and set the border and max border properties for the default window type decoration (Without these properties, CompWindow::input () would return 0,0,0,0 and an output frame wouldn't be created)
-rw-r--r--plugins/decor/src/decor.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/plugins/decor/src/decor.cpp b/plugins/decor/src/decor.cpp
index 985ab5c..d2bfadb 100644
--- a/plugins/decor/src/decor.cpp
+++ b/plugins/decor/src/decor.cpp
@@ -845,9 +845,7 @@ DecorWindow::update (bool allowDecoration)
if (decorate)
{
if (decor && checkSize (decor))
- {
decoration = decor;
- }
else
{
@@ -1434,9 +1432,12 @@ DecorWindow::windowNotify (CompWindowNotify n)
{
case CompWindowNotifyMap:
case CompWindowNotifyUnmap:
- foreach (CompWindow *cw, DecorScreen::get (screen)->cScreen->getWindowPaintList ())
+ if (dScreen->cmActive)
{
- DecorWindow::get (cw)->computeShadowRegion ();
+ foreach (CompWindow *cw, DecorScreen::get (screen)->cScreen->getWindowPaintList ())
+ {
+ DecorWindow::get (cw)->computeShadowRegion ();
+ }
}
break;
case CompWindowNotifyUnreparent:
@@ -1608,9 +1609,12 @@ DecorScreen::handleEvent (XEvent *event)
}
else if (event->xproperty.atom == XA_WM_TRANSIENT_FOR)
{
- foreach (CompWindow *cw, DecorScreen::get (screen)->cScreen->getWindowPaintList ())
+ if (cmActive)
{
- DecorWindow::get (cw)->computeShadowRegion ();
+ foreach (CompWindow *cw, cScreen->getWindowPaintList ())
+ {
+ DecorWindow::get (cw)->computeShadowRegion ();
+ }
}
}
else
@@ -1894,9 +1898,13 @@ DecorWindow::moveNotify (int dx, int dy, bool immediate)
}
updateReg = true;
- foreach (CompWindow *cw, DecorScreen::get (screen)->cScreen->getWindowPaintList ())
+ if (dScreen->cmActive)
{
- DecorWindow::get (cw)->computeShadowRegion ();
+ foreach (CompWindow *cw,
+ DecorScreen::get (screen)->cScreen->getWindowPaintList ())
+ {
+ DecorWindow::get (cw)->computeShadowRegion ();
+ }
}
window->moveNotify (dx, dy, immediate);
@@ -1930,9 +1938,13 @@ DecorWindow::resizeNotify (int dx, int dy, int dwidth, int dheight)
updateDecorationScale ();
updateReg = true;
- foreach (CompWindow *cw, DecorScreen::get (screen)->cScreen->getWindowPaintList ())
+ if (dScreen->cmActive)
{
- DecorWindow::get (cw)->computeShadowRegion ();
+ foreach (CompWindow *cw,
+ DecorScreen::get (screen)->cScreen->getWindowPaintList ())
+ {
+ DecorWindow::get (cw)->computeShadowRegion ();
+ }
}
window->resizeNotify (dx, dy, dwidth, dheight);
@@ -2033,7 +2045,10 @@ DecorScreen::DecorScreen (CompScreen *s) :
windowDefault.input.top = 1;
windowDefault.input.bottom = 0;
- windowDefault.maxInput = windowDefault.output = windowDefault.input;
+ windowDefault.border = windowDefault.maxBorder =
+ windowDefault.maxInput = windowDefault.output =
+ windowDefault.input;
+
windowDefault.refCount = 1;
cmActive = (cScreen) ? cScreen->compositingActive () &&