summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Frank Erikson <kristian@kristian-desktop.(none)>2008-11-20 11:19:32 +1300
committerKristian Frank Erikson <kristian@kristian-desktop.(none)>2008-11-20 11:19:32 +1300
commitd233df96a022812815426ab974198107b06ff80d (patch)
tree5a685efcb7739a37051872351cfd97bd39b18e2c
parentdebfd734c76b36968818da1ea7c414fa6a150ac9 (diff)
downloadcf-squeeze-d233df96a022812815426ab974198107b06ff80d.tar.gz
cf-squeeze-d233df96a022812815426ab974198107b06ff80d.tar.bz2
Slight update to resize animation. Still not finished though
-rw-r--r--squeeze.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/squeeze.c b/squeeze.c
index 4b52b4b..43f25f2 100644
--- a/squeeze.c
+++ b/squeeze.c
@@ -50,7 +50,7 @@
static int displayPrivateIndex;
-static int adjustSqueezeResize (CompWindow *w);
+static int adjustSqueezeResize (CompDisplay *d, CompWindow *w);
static void squeezeDoWindowResize (CompDisplay *d, int newWidth, int newHeight);
@@ -162,14 +162,15 @@ resizeGetScaleError (CompWindow *w,
float *yScale,
float *xScaleError,
float *yScaleError)
-{
- SQUEEZE_WINDOW (w);
-
- *xScaleError = (sw->padX - sw->targetX)
- - ((sw->padX - sw->targetX) * *xScale) * -2.0f;
-
- *yScaleError = (sw->padY - sw->targetY)
- - ((sw->padY - sw->targetY) * *yScale);
+{
+ *xScaleError = (w->serverBorderWidth)
+ - (w->serverBorderWidth * *xScale);
+
+ *yScaleError = (w->serverBorderWidth)
+ - (w->serverBorderWidth * *yScale);
+
+ //compLogMessage ("squeeze", CompLogLevelInfo,
+ // "xScaleError is: %i yScaleError is: %i", *xScaleError,*yScaleError);
// *xScaleError = -4.0f;
// *yScaleError = -4.0f;
}
@@ -179,11 +180,32 @@ resizeGetScaleError (CompWindow *w,
* Calculate width and height for animation
*/
static int
-adjustSqueezeResize (CompWindow *w)
+adjustSqueezeResize (CompDisplay *d,
+ CompWindow *w)
{
+ SQUEEZE_DISPLAY (d);
SQUEEZE_WINDOW (w);
+ /*From getPaintRectangle
+ pBox->x1 = sd->geometry.x - sd->w->input.left;
+ pBox->y1 = sd->geometry.y - sd->w->input.top;
+ pBox->x2 = sd->geometry.x +
+ sd->geometry.width + sd->w->serverBorderWidth * 2 +
+ sd->w->input.right;
+
+ if (sd->w->shaded)
+ {
+ pBox->y2 = sd->geometry.y + sd->w->height + sd->w->input.bottom;
+ }
+ else
+ {
+ pBox->y2 = sd->geometry.y +
+ sd->geometry.height + sd->w->serverBorderWidth * 2 +
+ sd->w->input.bottom;
+ }*/
+
+
if ( sw->resizeAnimActive )
{
// Increase the counter for the animation
@@ -428,7 +450,7 @@ squeezePreparePaintScreen (CompScreen *s,
compLogMessage ("squeeze", CompLogLevelInfo,
"TargetX is: %i Actual X is: %i", sw->targetX,w->attrib.x);
- sw->resizeAnimActive = adjustSqueezeResize (w);
+ sw->resizeAnimActive = adjustSqueezeResize (s->display, w);
if (!sw->resizeAnimActive)
squeezeDoWindowResize(s->display,sw->newWidth,sw->newHeight);
@@ -766,8 +788,8 @@ squeezeInitiateCommon (CompDisplay *d,
SQUEEZE_WINDOW (sd->w);
- sw->targetWidth = squeezeGetWidth (s);
- sw->targetHeight = squeezeGetHeight (s);
+ sw->targetWidth = squeezeGetWidth (s) - sd->w->serverBorderWidth * 2.0f;
+ sw->targetHeight = squeezeGetHeight (s) - sd->w->serverBorderWidth * 2.0f;
sw->lastWidth = w->serverWidth;
sw->lastHeight = w->serverHeight;