all repos — openbox @ ac241a8235be139ddfa15d6f2cbdcb64385c25d9

openbox fork - make it a bit more like ryudo

set the default icon onto windows which don't provide one
Dana Jansens danakj@orodu.net
commit

ac241a8235be139ddfa15d6f2cbdcb64385c25d9

parent

d2f7ad9a2480c2810dee5def13cbdee36bd71e5e

1 files changed, 19 insertions(+), 1 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -1887,7 +1887,25 @@ XFree(hints);

} } - if (self->frame) + /* set the default icon onto the window + in theory, this could be a race, but if a window doesn't set an icon + or removes it entirely, it's not very likely it is going to set one + right away afterwards */ + if (self->nicons == 0) { + RrPixel32 *icon = ob_rr_theme->def_win_icon; + + data = g_new(guint32, 48*48+2); + data[0] = data[1] = 48; + for (i = 0; i < 48*48; ++i) + data[i+2] = (((icon[i] >> RrDefaultAlphaOffset) & 0xff) << 24) + + (((icon[i] >> RrDefaultRedOffset) & 0xff) << 16) + + (((icon[i] >> RrDefaultGreenOffset) & 0xff) << 8) + + (((icon[i] >> RrDefaultBlueOffset) & 0xff) << 0); + PROP_SETA32(self->window, net_wm_icon, cardinal, data, 48*48+2); + g_free(data); + } else if (self->frame) + /* don't draw the icon empty if we're just setting one now anyways, + we'll get the property change any second */ frame_adjust_icon(self->frame); }