summaryrefslogtreecommitdiff
path: root/openbox/focus_cycle_popup.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-06-21 16:20:43 +0000
committerDana Jansens <danakj@orodu.net>2007-06-21 16:20:43 +0000
commit19ecd4d6d403e71abecb0e77f7ff0f4efa400be3 (patch)
tree99af58cd59d8f55a58ec5061e0d770a32d91dc61 /openbox/focus_cycle_popup.c
parentd158b642820910adf2d4f73370cf3537749230a6 (diff)
look, thumbnails in alt-tab. its such crap though. oh well, just for fun.
Diffstat (limited to 'openbox/focus_cycle_popup.c')
-rw-r--r--openbox/focus_cycle_popup.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c
index 477619f5..595fb9df 100644
--- a/openbox/focus_cycle_popup.c
+++ b/openbox/focus_cycle_popup.c
@@ -397,6 +397,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
they can pick up the hilite changes in the backgroud */
if (!p->mapped || newtarget == target || p->last_target == target) {
const ObClientIcon *icon;
+ ObClientIcon *thumb;
const gint row = i / icons_per_row; /* starting from 0 */
const gint col = i % icons_per_row; /* starting from 0 */
gint innerx, innery;
@@ -412,17 +413,27 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
innerx, innery, innerw, innerh);
/* get the icon from the client */
- icon = client_icon(target->client, innerw, innerh);
- p->a_icon->texture[0].data.rgba.width = icon->width;
- p->a_icon->texture[0].data.rgba.height = icon->height;
- p->a_icon->texture[0].data.rgba.alpha =
- target->client->iconic ? OB_ICONIC_ALPHA : 0xff;
- p->a_icon->texture[0].data.rgba.data = icon->data;
+ if ((thumb = client_thumbnail(target->client))) {
+ p->a_icon->texture[0].data.rgba.width = thumb->width;
+ p->a_icon->texture[0].data.rgba.height = thumb->height;
+ p->a_icon->texture[0].data.rgba.alpha =
+ target->client->iconic ? OB_ICONIC_ALPHA : 0xff;
+ p->a_icon->texture[0].data.rgba.data = thumb->data;
+ } else {
+ icon = client_icon(target->client, innerw, innerh);
+ p->a_icon->texture[0].data.rgba.width = icon->width;
+ p->a_icon->texture[0].data.rgba.height = icon->height;
+ p->a_icon->texture[0].data.rgba.alpha =
+ target->client->iconic ? OB_ICONIC_ALPHA : 0xff;
+ p->a_icon->texture[0].data.rgba.data = icon->data;
+ }
/* draw the icon */
p->a_icon->surface.parentx = innerx;
p->a_icon->surface.parenty = innery;
RrPaint(p->a_icon, target->win, innerw, innerh);
+
+ clienticon_free(thumb);
}
}