X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus_cycle_popup.c;h=89c3c82c0925f20e917e384060ac1951cfc263e4;hb=39d94f0db04dc62bf44a24e152550e504cb6649d;hp=e282465e4d44295d56244a1e5da2f8b3855cf9b2;hpb=5d9b0596016f2b72cc8851a20c6e21b331f91a2a;p=chaz%2Fopenbox diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index e282465e..89c3c82c 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -405,6 +405,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) const gint row = i / icons_per_row; /* starting from 0 */ const gint col = i % icons_per_row; /* starting from 0 */ gint innerx, innery; + RrPixel32 *icon_data; /* find the dimensions of the icon inside it */ innerx = icons_center_x + l + (col * ICON_SIZE); @@ -420,12 +421,33 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) 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.data = icon->data; + if (target->client->iconic) { + /* fade iconic windows */ + gint i; + RrPixel32 *d, *s; + + icon_data = g_new(RrPixel32, icon->width * icon->height); + + s = icon->data; + d = icon_data; + for (i = 0; i < icon->width * icon->height; ++i, ++d, ++s) { + /* 7/16 opacity */ + gint a = ((*s >> RrDefaultAlphaOffset) & 0xff); + *d = *s - (a << RrDefaultAlphaOffset) + + (((a>>1) - (a>>4)) << RrDefaultAlphaOffset); + } + + } else + icon_data = icon->data; + 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); + + if (target->client->iconic) + g_free(icon_data); } }