summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-07-17 08:09:34 +0200
committerDanny Baumann <dannybaumann@web.de>2008-07-17 08:09:34 +0200
commit5724e67cf68becff345ce67fe7f9cb271faef8ad (patch)
tree5661b2186a55ea29b721ee0072d2506ffd03efe6
parent8b8ad55fc130f0aa8357441555f1728aba60c335 (diff)
downloadgroup-5724e67cf68becff345ce67fe7f9cb271faef8ad.tar.gz
group-5724e67cf68becff345ce67fe7f9cb271faef8ad.tar.bz2
Fix nasty pixmap leak.
-rw-r--r--cairo.c8
-rw-r--r--group-internal.h7
2 files changed, 13 insertions, 2 deletions
diff --git a/cairo.c b/cairo.c
index 308b6ab..c54f141 100644
--- a/cairo.c
+++ b/cairo.c
@@ -79,6 +79,9 @@ groupDestroyCairoLayer (CompScreen *s,
finiTexture (s, &layer->texture);
+ if (layer->pixmap)
+ XFreePixmap (s->display->display, layer->pixmap);
+
if (layer->buffer)
free (layer->buffer);
@@ -104,6 +107,7 @@ groupCreateCairoLayer (CompScreen *s,
layer->surface = NULL;
layer->cairo = NULL;
layer->buffer = NULL;
+ layer->pixmap = None;
layer->animationTime = 0;
layer->state = PaintOff;
@@ -711,7 +715,9 @@ groupRenderWindowTitle (GroupSelection *group)
layer->texHeight = height;
if (data)
- bindPixmapToTexture (s, &layer->texture, (Pixmap) data,
+ {
+ layer->pixmap = (Pixmap) data;
+ bindPixmapToTexture (s, &layer->texture, layer->pixmap,
layer->texWidth, layer->texHeight, 32);
}
diff --git a/group-internal.h b/group-internal.h
index 4ef1d80..f3d4244 100644
--- a/group-internal.h
+++ b/group-internal.h
@@ -228,11 +228,16 @@ typedef enum {
} TabbingState;
typedef struct _GroupCairoLayer {
- unsigned char *buffer;
CompTexture texture;
+
+ /* used if layer is used for cairo drawing */
+ unsigned char *buffer;
cairo_surface_t *surface;
cairo_t *cairo;
+ /* used if layer is used for text drawing */
+ Pixmap pixmap;
+
int texWidth;
int texHeight;