void (*screen_root_pixmap_change)(d_screen_t *sc);
void (*window_show)(d_window_t *w);
void (*window_zombie_dead)(d_window_t *w);
- void (*window_move)(d_window_t *w);
void (*window_resize)(d_window_t *w);
void (*window_reshape)(d_window_t *w);
static void glxrender_root_pixmap_change(d_screen_t *sc);
static void paint_root(d_screen_t *sc, data_t *d);
static void paint_window(d_window_t *window, data_t *d, window_data_t *wd,
+ int x, int y, GLfloat z);
+static void paint_shadow(data_t *d, window_data_t *wd, int x, int y,
GLfloat z);
-static void paint_shadow(data_t *d, window_data_t *wd, GLfloat z);
static void glxrender_update_window_pixmap(d_window_t *w, data_t *d,
window_data_t *wd);
static void glxrender_update_window_region(d_window_t *w, window_data_t *wd);
static void glxrender_window_show(d_window_t *window);
static void glxrender_window_zombie_dead(d_window_t *window);
-static void glxrender_window_move(d_window_t *window);
static void glxrender_window_resize(d_window_t *window);
static void glxrender_window_reshape(d_window_t *window);
d->window_show = sc->window_show;
d->window_zombie_dead = sc->window_zombie_dead;
d->window_resize = sc->window_resize;
- d->window_move = sc->window_move;
d->window_reshape = sc->window_reshape;
screen_add_plugin_data(sc, plugin_id, d);
sc->window_show = glxrender_window_show;
sc->window_zombie_dead = glxrender_window_zombie_dead;
sc->window_resize = glxrender_window_resize;
- sc->window_move = glxrender_window_move;
sc->window_reshape = glxrender_window_reshape;
d->shadowalpha = 0.2f; /* 20% */
(GLfloat)(rects[i].y - area.y + rects[i].height) /
(GLfloat)area.height;
- wd->vertices[i+LEFT] = rects[i].x;
- wd->vertices[i+TOP] = rects[i].y;
- wd->vertices[i+RIGHT] = rects[i].x + rects[i].width;
- wd->vertices[i+BOTTOM] = rects[i].y + rects[i].height;
+ wd->vertices[i+LEFT] = rects[i].x - x;
+ wd->vertices[i+TOP] = rects[i].y - y;
+ wd->vertices[i+RIGHT] = rects[i].x - x + rects[i].width;
+ wd->vertices[i+BOTTOM] = rects[i].y - y + rects[i].height;
}
if (rep)
}
static void
-glxrender_window_move(d_window_t *w)
-{
- data_t *d;
- window_data_t *wd;
-
- d = screen_find_plugin_data(w->sc, plugin_id);
- wd = window_find_plugin_data(w, plugin_id);
-
- /* pass it on */
- d->window_move(w);
-
- assert(wd != NULL);
- glxrender_update_window_region(w, wd);
-}
-
-static void
glxrender_window_reshape(d_window_t *w)
{
data_t *d;
//glPushMatrix();
- paint_window(w, d, wd, z + 0.05f);
+ paint_window(w, d, wd, x, y, z - 0.05f);
//glPopMatrix();
}
alpha /= 0xffff;
if (alpha >= 0.01) {
glColor4f(0.0f, 0.0f, 0.0f, alpha);
- paint_shadow(d, wd, z);
+ paint_shadow(d, wd, x, y, z);
}
if (!opaque) {
glColor4us(opac, opac, opac, opac);
- paint_window(w, d, wd, z + 0.05f);
+ paint_window(w, d, wd, x, y, z + 0.05f);
}
//glPopMatrix();
}
static void
-paint_window(d_window_t *w, data_t *d, window_data_t *wd, GLfloat z)
+paint_window(d_window_t *w, data_t *d, window_data_t *wd, int x, int y,
+ GLfloat z)
{
int i;
glBegin(GL_QUADS);
for (i = 0; i < wd->nrects * 4; i += 4) {
glTexCoord2f(wd->texcoords[i+LEFT], wd->texcoords[i+TOP]);
- glVertex3f(wd->vertices[i+LEFT], wd->vertices[i+TOP], z);
+ glVertex3f(x+wd->vertices[i+LEFT], y+wd->vertices[i+TOP], z);
glTexCoord2f(wd->texcoords[i+RIGHT], wd->texcoords[i+TOP]);
- glVertex3f(wd->vertices[i+RIGHT], wd->vertices[i+TOP], z);
+ glVertex3f(x+wd->vertices[i+RIGHT], y+wd->vertices[i+TOP], z);
glTexCoord2f(wd->texcoords[i+RIGHT], wd->texcoords[i+BOTTOM]);
- glVertex3f(wd->vertices[i+RIGHT], wd->vertices[i+BOTTOM], z);
+ glVertex3f(x+wd->vertices[i+RIGHT], y+wd->vertices[i+BOTTOM], z);
glTexCoord2f(wd->texcoords[i+LEFT], wd->texcoords[i+BOTTOM]);
- glVertex3f(wd->vertices[i+LEFT], wd->vertices[i+BOTTOM], z);
+ glVertex3f(x+wd->vertices[i+LEFT], y+wd->vertices[i+BOTTOM], z);
}
glEnd();
}
static void
-paint_shadow(data_t *d, window_data_t *wd, GLfloat z)
+paint_shadow(data_t *d, window_data_t *wd, int x, int y, GLfloat z)
{
- int xoff = d->xshadowoff;
- int yoff = d->yshadowoff;
int i;
if (wd->nrects < 1) return;
/* shape the shadow to the window */
glBindTexture(GL_TEXTURE_2D, wd->texname);
+ x += d->xshadowoff;
+ y += d->yshadowoff;
+
glBegin(GL_QUADS);
for (i = 0; i < wd->nrects * 4; i += 4) {
glTexCoord2f(wd->texcoords[i+LEFT], wd->texcoords[i+TOP]);
- glVertex3f(xoff+wd->vertices[i+LEFT], yoff+wd->vertices[i+TOP], z);
+ glVertex3f(x+wd->vertices[i+LEFT], y+wd->vertices[i+TOP], z);
glTexCoord2f(wd->texcoords[i+RIGHT], wd->texcoords[i+TOP]);
- glVertex3f(xoff+wd->vertices[i+RIGHT], yoff+wd->vertices[i+TOP], z);
+ glVertex3f(x+wd->vertices[i+RIGHT], y+wd->vertices[i+TOP], z);
glTexCoord2f(wd->texcoords[i+RIGHT], wd->texcoords[i+BOTTOM]);
- glVertex3f(xoff+wd->vertices[i+RIGHT], yoff+wd->vertices[i+BOTTOM], z);
+ glVertex3f(x+wd->vertices[i+RIGHT], y+wd->vertices[i+BOTTOM], z);
glTexCoord2f(wd->texcoords[i+LEFT], wd->texcoords[i+BOTTOM]);
- glVertex3f(xoff+wd->vertices[i+LEFT], yoff+wd->vertices[i+BOTTOM], z);
+ glVertex3f(x+wd->vertices[i+LEFT], y+wd->vertices[i+BOTTOM], z);
}
glEnd();