summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/group
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 14:28:54 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 14:28:54 +0000
commit51575c12f6e0edba7988d9a4f606f2ad02e553df (patch)
tree40ef831da2a597c5c5e7bc87152e7cf2c46a1c39 /beryl-plugins/src/group
parent62ef7ad35846463531dbcbd5d47c11adf885770d (diff)
downloadmarex-dev-51575c12f6e0edba7988d9a4f606f2ad02e553df.tar.gz
marex-dev-51575c12f6e0edba7988d9a4f606f2ad02e553df.tar.bz2
group plugin: correctly apply tab bar background texture stretch
git-svn-id: file:///beryl/trunk@4029 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/group')
-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);
+ }
}
}