summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--beryl-plugins/src/group/paint.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/beryl-plugins/src/group/paint.c b/beryl-plugins/src/group/paint.c
index cf7e29f..5e2aac4 100644
--- a/beryl-plugins/src/group/paint.c
+++ b/beryl-plugins/src/group/paint.c
@@ -416,7 +416,6 @@ void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib,
if (layer) {
CompMatrix matrix = layer->texture.matrix;
- FragmentAttrib fragment;
// remove the old x1 and y1 so we have a relative value
box.extents.x2 -= box.extents.x1;
@@ -443,24 +442,38 @@ void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib,
topTab->vCount = 0;
- initFragmentAttrib(&fragment, &attrib);
addWindowGeometry(topTab, &matrix, 1, &box, clipRegion);
- alpha = alpha * wAttrib->opacity / 0xffff;
+ if (topTab->vCount)
+ {
+ FragmentAttrib fragment;
+ CompTransform wTransform = *transform;
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glColor4us(alpha, alpha, alpha, alpha);
+ matrixTranslate (&wTransform, WIN_X(topTab), WIN_Y(topTab), 0.0f);
+ matrixScale (&wTransform, attrib.xScale, attrib.yScale, 0.0f);
+ matrixTranslate (&wTransform,
+ attrib.xTranslate / attrib.xScale - WIN_X(topTab),
+ attrib.yTranslate / attrib.yScale - WIN_Y(topTab), 0.0f);
- if (topTab->vCount)
- (*group->screen->drawWindowTexture) (topTab,
- &layer->texture, &fragment, mask |
- PAINT_WINDOW_TRANSLUCENT_MASK |
- PAINT_WINDOW_TRANSFORMED_MASK);
+ glPushMatrix();
+ glLoadMatrixf(wTransform.m);
- screenTexEnvMode(s, GL_REPLACE);
+ initFragmentAttrib(&fragment, &attrib);
- glColor4usv(defaultColor);
+ alpha = alpha * wAttrib->opacity / 0xffff;
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ glColor4us(alpha, alpha, alpha, alpha);
+
+ (*group->screen->drawWindowTexture) (topTab, &layer->texture,
+ &fragment, mask | PAINT_WINDOW_TRANSLUCENT_MASK |
+ PAINT_WINDOW_TRANSFORMED_MASK);
+
+ glPopMatrix();
+
+ screenTexEnvMode(s, GL_REPLACE);
+ glColor4usv(defaultColor);
+ }
}
}