all repos — openbox @ a081582e3a4c27aede31c170337aed6b5a5309cc

openbox fork - make it a bit more like ryudo

fix window icon rendering, was using incorrect size.
Dana Jansens danakj@orodu.net
commit

a081582e3a4c27aede31c170337aed6b5a5309cc

parent

02c7f2e8afbfe5ebc589415a87a2ac156c9ef5af

3 files changed, 25 insertions(+), 16 deletions(-)

jump to
M render/image.crender/image.c

@@ -2,13 +2,19 @@ #include <glib.h>

#include "../kernel/geom.h" #include "image.h" -void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position) +void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position, + Rect *surarea) { unsigned long *draw = rgba->data; int c, sfw, sfh; - unsigned int i, e, bgi; + unsigned int i, e; sfw = position->width; sfh = position->height; + + /* it would be nice if this worked, but this function is well broken in these + cercumstances. */ + g_assert(position->width == surarea->width && + position->height == surarea->height); g_assert(rgba->data != NULL);

@@ -42,7 +48,7 @@ if (rgba->width != sfw || rgba->height != sfh)

draw = rgba->cache; /* apply the alpha channel */ - for (i = 0, c = 0, e = sfw*sfh; i < e; ++i, ++bgi) { + for (i = 0, c = 0, e = sfw*sfh; i < e; ++i) { unsigned char alpha = draw[i] >> 24; unsigned char r = draw[i] >> 16; unsigned char g = draw[i] >> 8;
M render/image.hrender/image.h

@@ -4,6 +4,7 @@

#include "render.h" #include "../kernel/geom.h" -void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position); +void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position, + Rect *surarea); #endif
M render/render.crender/render.c

@@ -233,20 +233,22 @@ else gradient_render(&l->surface, w, h);

for (i = 0; i < l->textures; i++) { tarea = l->texture[i].position; - if (l->surface.data.planar.relief != Flat) { - switch (l->surface.data.planar.bevel) { - case Bevel1: + if (l->surface.data.planar.grad != Background_ParentRelative) { + if (l->surface.data.planar.relief != Flat) { + switch (l->surface.data.planar.bevel) { + case Bevel1: + tarea.x += 1; tarea.y += 1; + tarea.width -= 2; tarea.height -= 2; + break; + case Bevel2: + tarea.x += 2; tarea.y += 2; + tarea.width -= 4; tarea.height -= 4; + break; + } + } else if (l->surface.data.planar.border) { tarea.x += 1; tarea.y += 1; tarea.width -= 2; tarea.height -= 2; - break; - case Bevel2: - tarea.x += 2; tarea.y += 2; - tarea.width -= 4; tarea.height -= 4; - break; } - } else if (l->surface.data.planar.border) { - tarea.x += 1; tarea.y += 1; - tarea.width -= 2; tarea.height -= 2; } switch (l->texture[i].type) {

@@ -279,7 +281,7 @@ break;

case RGBA: image_draw(l->surface.data.planar.pixel_data, &l->texture[i].data.rgba, - &tarea); + &tarea, &l->area); break; } }