X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Frender.c;h=13257910d08368d16bd03a1f381935d59a2f0852;hb=d42335e54d9eb70957eb3f4938b69cc3682cfec2;hp=fdbab06f340fe9c11b1c2aacecdfb6b1f9bd6991;hpb=fdabd3daf9c631f53408d82c9168705dc6a2832a;p=chaz%2Fopenbox diff --git a/render/render.c b/render/render.c index fdbab06f..13257910 100644 --- a/render/render.c +++ b/render/render.c @@ -66,7 +66,7 @@ void x_paint(Window win, Appearance *l, int x, int y, int w, int h) // printf("painting window %ld\n", win); oldp = l->pixmap; /* save to free after changing the visible pixmap */ - l->pixmap = XCreatePixmap(ob_display, ob_root, w, h, render_depth); + l->pixmap = XCreatePixmap(ob_display, ob_root, x+w, y+h, render_depth); g_assert(l->pixmap != None); if (l->xftdraw != NULL) @@ -80,7 +80,7 @@ void x_paint(Window win, Appearance *l, int x, int y, int w, int h) l->surface.data.planar.pixel_data = g_new(pixel32, w * h); if (l->surface.data.planar.grad == Background_Solid) - gradient_solid(l, w, h); + gradient_solid(l, x, y, w, h); else gradient_render(&l->surface, w, h); /*reduce depth here... @@ -94,7 +94,7 @@ void x_paint(Window win, Appearance *l, int x, int y, int w, int h) im->byte_order = endian; im->data = l->surface.data.planar.pixel_data; XPutImage(ob_display, l->pixmap, DefaultGC(ob_display, ob_screen), - im, 0, 0, 0, 0, w, h); + im, 0, 0, x, y, w, h); im->data = NULL; XDestroyImage(im); } @@ -106,7 +106,7 @@ void x_paint(Window win, Appearance *l, int x, int y, int w, int h) l->xftdraw = XftDrawCreate(ob_display, l->pixmap, render_visual, render_colormap); } - font_draw(l->xftdraw, &l->texture[i].data.text); + font_draw(l->xftdraw, &l->texture[i].data.text, x, y, w, h); break; case Bitmask: if (l->texture[i].data.mask.color->gc == None) @@ -141,6 +141,7 @@ Appearance *appearance_new(SurfaceType type, int numtex) out->textures = numtex; out->xftdraw = NULL; if (numtex) out->texture = g_new(Texture, numtex); + else out->texture = NULL; out->pixmap = None; switch (type) { @@ -191,10 +192,7 @@ Appearance *appearance_copy(Appearance *orig) break; } copy->textures = orig->textures; - if (orig->textures) { - copy->texture = malloc(orig->textures * sizeof(Texture)); - memcpy(copy->texture, orig->texture, orig->textures * sizeof(Texture)); - } else copy->texture = NULL; + copy->texture = g_memdup(orig->texture, orig->textures * sizeof(Texture)); copy->pixmap = None; copy->xftdraw = NULL; return copy; @@ -212,6 +210,7 @@ void appearance_free(Appearance *a) if (p->primary != NULL) color_free(p->primary); if (p->secondary != NULL) color_free(p->secondary); if (p->border_color != NULL) color_free(p->border_color); + if (p->pixel_data != NULL) g_free(p->pixel_data); } g_free(a); }