diff --git a/include/compiz-core.h b/include/compiz-core.h index e976d59..a81d0cd 100644 --- a/include/compiz-core.h +++ b/include/compiz-core.h @@ -1614,6 +1614,7 @@ struct _CompTexture { GLenum target; GLfloat dx, dy; GLXPixmap pixmap; + Bool pixmapDamaged; GLenum filter; GLenum wrap; CompMatrix matrix; diff --git a/plugins/decoration.c b/plugins/decoration.c index 7fd617e..a3da8b9 100644 --- a/plugins/decoration.c +++ b/plugins/decoration.c @@ -978,7 +978,8 @@ decorHandleEvent (CompDisplay *d, DecorScreen *ds; CompScreen *s; - t->texture.oldMipmaps = TRUE; + t->texture.oldMipmaps = TRUE; + t->texture.pixmapDamaged = TRUE; for (s = d->screens; s; s = s->next) { diff --git a/src/event.c b/src/event.c index f78002a..3c027ef 100644 --- a/src/event.c +++ b/src/event.c @@ -2215,7 +2215,8 @@ handleEvent (CompDisplay *d, if (w) { - w->texture->oldMipmaps = TRUE; + w->texture->oldMipmaps = TRUE; + w->texture->pixmapDamaged = TRUE; if (w->syncWait) { diff --git a/src/texture.c b/src/texture.c index 0002e03..9a420be 100644 --- a/src/texture.c +++ b/src/texture.c @@ -298,6 +298,8 @@ bindPixmapToTexture (CompScreen *screen, return FALSE; } + texture->pixmapDamaged = FALSE; + if (!target) (*screen->queryDrawable) (screen->display->display, texture->pixmap, @@ -411,7 +413,14 @@ enableTexture (CompScreen *screen, glEnable (texture->target); glBindTexture (texture->target, texture->name); - if (strictBinding && texture->pixmap) + if (texture->pixmap && texture->pixmapDamaged && !strictBinding) + { + (*screen->releaseTexImage) (screen->display->display, + texture->pixmap, + GLX_FRONT_LEFT_EXT); + } + + if (texture->pixmap && (strictBinding || texture->pixmapDamaged)) { (*screen->bindTexImage) (screen->display->display, texture->pixmap, @@ -419,6 +428,8 @@ enableTexture (CompScreen *screen, NULL); } + texture->pixmapDamaged = FALSE; + if (filter == COMP_TEXTURE_FILTER_FAST) { if (texture->filter != GL_NEAREST)