diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-04-24 15:56:37 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-04-24 15:56:37 +0000 |
| commit | ac241a8235be139ddfa15d6f2cbdcb64385c25d9 (patch) | |
| tree | 987ded134cd203588b8c2922375f2ceaab29da30 | |
| parent | d2f7ad9a2480c2810dee5def13cbdee36bd71e5e (diff) | |
set the default icon onto windows which don't provide one
| -rw-r--r-- | openbox/client.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/openbox/client.c b/openbox/client.c index 0ff67ac5..2f4e1772 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1887,7 +1887,25 @@ void client_update_icons(ObClient *self) } } - 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); } |
