X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=771294a4b3081897fc9db34da889040ae33c7e5a;hb=1b7e813c62a6e54690d15550d51ac4269e63f346;hp=cf6965ae24ade67a84338309fe434ebad6d9d0fe;hpb=0e2492a501a41105ee688133ded8ec7d2a755904;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index cf6965ae..771294a4 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -4083,3 +4083,30 @@ gboolean client_has_group_siblings(ObClient *self) { return self->group && self->group->members->next; } + +ObClientIcon *client_thumbnail(ObClient *self, gint wantw, gint wanth) +{ + ObClientIcon *ret; + RrPixel32 *data; + gint w, h; + + if (!self->frame->pixmap) return NULL; + if (!RrPixmapToRGBA(ob_rr_inst, self->frame->pixmap, None, &w, &h, &data)) + return NULL; + + /* resize the thumbnail (within aspect ratio) to the given sizes */ + + ret = g_new(ObClientIcon, 1); + ret->data = data; + ret->width = w; + ret->height = h; + return ret; +} + +void clienticon_free(ObClientIcon *ci) +{ + if (ci) { + g_free(ci->data); + g_free(ci); + } +}