]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
look, thumbnails in alt-tab. its such crap though. oh well, just for fun.
[chaz/openbox] / openbox / client.c
index cf6965ae24ade67a84338309fe434ebad6d9d0fe..771294a4b3081897fc9db34da889040ae33c7e5a 100644 (file)
@@ -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);
+    }
+}
This page took 0.022269 seconds and 4 git commands to generate.