summaryrefslogtreecommitdiff
path: root/beryl-plugins-unsupported/src/tile.c
diff options
context:
space:
mode:
Diffstat (limited to 'beryl-plugins-unsupported/src/tile.c')
-rw-r--r--beryl-plugins-unsupported/src/tile.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/beryl-plugins-unsupported/src/tile.c b/beryl-plugins-unsupported/src/tile.c
index 388c657..fa2cd8c 100644
--- a/beryl-plugins-unsupported/src/tile.c
+++ b/beryl-plugins-unsupported/src/tile.c
@@ -209,7 +209,8 @@ static Bool setWindowFutureSize(CompWindow *w);
int current = 0;
// window painting function, draws animation
-static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Region region, unsigned int mask)
+static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib,
+ const CompTransform * transform, Region region, unsigned int mask)
{
CompScreen *s = w->screen;
Bool status;
@@ -224,6 +225,8 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Re
if(tw->isResizing && td->currentAnimationType != outline) // on window texture animation
{
WindowPaintAttrib sAttrib = *attrib;
+ FragmentAttrib fragment;
+ initFragmentAttrib (&fragment, &sAttrib);
glPushMatrix();
glLoadIdentity();
@@ -236,7 +239,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Re
*/
case drop:
glRotatef(100.0f/td->animationDuration*ts->msResizing - 100, 0,0,1);
- (*s->drawWindow) (w, &sAttrib, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
break;
/*
@@ -244,7 +247,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Re
*/
case zoom:
glTranslatef(0,0, -1 + ts->msResizing/(float)td->animationDuration);
- (*s->drawWindow) (w, &sAttrib, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
break;
/*
@@ -258,7 +261,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Re
if(ts->msResizing > current*ts->oneDuration) // windows that have animation finished already
{
- (*s->drawWindow) (w, &sAttrib, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
else if(ts->msResizing > (current-1)*ts->oneDuration && ts->msResizing < current*ts->oneDuration) // animation in progress
{
@@ -271,7 +274,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Re
else
glTranslatef(s->width - s->width * (float)thisDur/ts->oneDuration, 0, 0);
- (*s->drawWindow) (w, &sAttrib, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
break;
@@ -290,14 +293,14 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Re
if(ts->msResizing < 0.40f*td->animationDuration)
{
sAttrib.opacity = OPAQUE - OPAQUE*ts->msResizing/(0.40f*td->animationDuration);
- (*s->drawWindow) (w, &sAttrib, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
else if(ts->msResizing > 0.40f*td->animationDuration && !tw->resizedAlready) // resize window right after first half
setWindowFutureSize(w);
else if(ts->msResizing > 0.60f*td->animationDuration) // second half of animation, fade in
{
sAttrib.opacity = OPAQUE*(ts->msResizing - 0.60f*td->animationDuration)/(0.40f*td->animationDuration);
- (*s->drawWindow) (w, &sAttrib, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
+ (*s->drawWindow) (w, transform, &fragment, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
break;
}
@@ -308,7 +311,7 @@ static Bool tilePaintWindow(CompWindow * w, const WindowPaintAttrib * attrib, Re
else // paint window as always
{
UNWRAP(ts, s, paintWindow);
- status = (*s->paintWindow) (w, attrib, region, mask);
+ status = (*s->paintWindow) (w, attrib, transform, region, mask);
WRAP(ts, s, paintWindow, tilePaintWindow);
}
@@ -362,7 +365,10 @@ static void tileDonePaintScreen(CompScreen * s)
WRAP(ts, s, donePaintScreen, tileDonePaintScreen);
}
-static Bool tilePaintScreen(CompScreen * s, const ScreenPaintAttrib * sa, Region region, int output, unsigned int mask)
+static Bool tilePaintScreen(CompScreen * s,
+ const ScreenPaintAttrib * sa,
+ const CompTransform * transform,
+ Region region, int output, unsigned int mask)
{
Bool status;
@@ -373,7 +379,7 @@ static Bool tilePaintScreen(CompScreen * s, const ScreenPaintAttrib * sa, Region
mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
UNWRAP(ts, s, paintScreen);
- status = (*s->paintScreen) (s, sa, region, output, mask);
+ status = (*s->paintScreen) (s, sa, transform, region, output, mask);
WRAP(ts, s, paintScreen, tilePaintScreen);
// Check if animation is enabled, there is resizing on screen and only outline should be drawn