summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Frank Erikson <kristian@kristian-desktop.(none)>2008-11-20 14:46:01 +1300
committerKristian Frank Erikson <kristian@kristian-desktop.(none)>2008-11-20 14:46:01 +1300
commit7124de5f943a6fc17d3db355288372d11f51121a (patch)
treeab2fb7439a3d91c2d227c2abf12e65dd555c11c1
parent4de57960174db7eee8e74589cb218f528045f321 (diff)
downloadcf-squeeze-7124de5f943a6fc17d3db355288372d11f51121a.tar.gz
cf-squeeze-7124de5f943a6fc17d3db355288372d11f51121a.tar.bz2
Improved the resize animation by doing resize animation first and then scaling in OpenGL
-rw-r--r--squeeze.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/squeeze.c b/squeeze.c
index eed46e7..1600e5d 100644
--- a/squeeze.c
+++ b/squeeze.c
@@ -111,7 +111,7 @@ resizeGetPaintRectangle (CompDisplay *d,
pBox->x1 = sw->targetX + sd->w->input.left;
pBox->y1 = sw->targetY + sd->w->input.right;
- pBox->x2 = sw->targetX + sw->lastWidth
+ pBox->x2 = sw->targetX + sw->targetWidth
+ sd->w->serverBorderWidth * 2 + sd->w->input.right;
if (sd->w->shaded)
@@ -120,7 +120,7 @@ resizeGetPaintRectangle (CompDisplay *d,
}
else
{
- pBox->y2 = sw->targetY + sw->lastHeight
+ pBox->y2 = sw->targetY + sw->targetHeight
+ sd->w->serverBorderWidth * 2 + sd->w->input.bottom;
}
}
@@ -167,10 +167,13 @@ adjustSqueezeResize (CompWindow *w)
if (percentComplete < 1)
{
- sw->newWidth = (int) ((sw->targetWidth - sw->lastWidth)
- * percentComplete) + sw->lastWidth;
- sw->newHeight = (int) ((sw->targetHeight - sw->lastHeight)
- * percentComplete) + sw->lastHeight;
+ sw->newWidth = sw->lastWidth
+ + (int) ((sw->targetWidth - sw->lastWidth)
+ * percentComplete);
+
+ sw->newHeight = sw->lastHeight
+ + (int) ((sw->targetHeight - sw->lastHeight)
+ * percentComplete);
}
else
{
@@ -386,6 +389,9 @@ squeezePreparePaintScreen (CompScreen *s,
updateWindowAttributes (w, CompStackingUpdateModeNone);
endAnimationWindow = w->id;
sw->tx = sw->ty = 0;
+ //If the animation is complete do the actual resize
+ squeezeDoWindowResize(s->display,
+ sw->newWidth,sw->newHeight);
}
}
@@ -393,13 +399,11 @@ squeezePreparePaintScreen (CompScreen *s,
if (sw->resizeAnimActive & !sw->putAnimActive)
{
sw->resizeAnimActive = adjustSqueezeResize (w);
-
+ /*
if (!sw->resizeAnimActive)
{
- //If the animation is complete do the actual resize
- squeezeDoWindowResize(s->display,
- sw->newWidth,sw->newHeight);
- }
+
+ }*/
// Make sure animation flag stays on
ss->animationsActive |= sw->resizeAnimActive;