summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2008-12-05 06:54:34 -0500
committerDavid Reveman <davidr@novell.com>2008-12-05 06:54:34 -0500
commit483a7a79b106f6623dbccc31ef9fecb56fa8c46c (patch)
treef175fc5f88cf9188e47afc0ddc48852b6aeb7b5b
parent862b3964872cd045b241a6c1c47592921d7180ef (diff)
downloadplugins-extra-nomad-0.7.8.tar.gz
plugins-extra-nomad-0.7.8.tar.bz2
Handle non top-level windows properly in cubeaddon plugin.nomad-0.7.8
-rw-r--r--src/cubeaddon/cubeaddon.c50
1 files changed, 40 insertions, 10 deletions
diff --git a/src/cubeaddon/cubeaddon.c b/src/cubeaddon/cubeaddon.c
index 6748534..f02bb17 100644
--- a/src/cubeaddon/cubeaddon.c
+++ b/src/cubeaddon/cubeaddon.c
@@ -865,6 +865,7 @@ cubeaddonAddWindowGeometry (CompWindow *w,
float inv = (cs->invert == 1) ? 1.0 : -1.0;
float a1, a2, ang;
+ CompWindow *p;
if (cubeaddonGetDeformation (s) == DeformationCylinder || cs->unfolded)
{
@@ -961,14 +962,28 @@ cubeaddonAddWindowGeometry (CompWindow *w,
v = w->vertices + (w->vertexStride - 3);
v += w->vertexStride * oldVCount;
- if (!windowOnAllViewports (w))
+ for (p = w; p; p = p->parent)
{
- getWindowMovementForOffset (w,
- s->root.viewportOffsetX,
- s->root.viewportOffsetY,
- &offX, &offY);
+ offX += p->attrib.x;
+ offY += p->attrib.y;
+
+ if (p->parent == &s->root && !windowOnAllViewports (p))
+ {
+ int x, y;
+
+ getWindowMovementForOffset (p,
+ s->root.viewportOffsetX,
+ s->root.viewportOffsetY,
+ &x, &y);
+
+ offX += x;
+ offY += y;
+ }
}
+ offX -= w->attrib.x;
+ offY -= w->attrib.y;
+
if (cs->moMode == CUBE_MOMODE_ONE)
{
sx1 = 0;
@@ -1103,17 +1118,32 @@ cubeaddonDrawWindow (CompWindow *w,
if (!(mask & PAINT_WINDOW_TRANSFORMED_MASK) && cas->deform)
{
+ CompWindow *p;
int offX = 0, offY = 0;
int x1, x2;
- if (!windowOnAllViewports (w))
+ for (p = w; p; p = p->parent)
{
- getWindowMovementForOffset (w,
- s->root.viewportOffsetX,
- s->root.viewportOffsetY,
- &offX, &offY);
+ offX += p->attrib.x;
+ offY += p->attrib.y;
+
+ if (p->parent == &s->root && !windowOnAllViewports (p))
+ {
+ int x, y;
+
+ getWindowMovementForOffset (p,
+ s->root.viewportOffsetX,
+ s->root.viewportOffsetY,
+ &x, &y);
+
+ offX += x;
+ offY += y;
+ }
}
+ offX -= w->attrib.x;
+ offY -= w->attrib.y;
+
x1 = w->attrib.x - w->output.left + offX;
x2 = w->attrib.x + w->width + w->output.right + offX;
if (x1 < 0 && x2 < 0)