X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus_cycle_popup.c;h=13f12da514fac6b3a60eea04472d7e145ec3357b;hb=db4bc708d3923016095bfc34e4cde871ea3c4800;hp=a44a8cc646fbcb1df95f420d704b31ea316e07a1;hpb=b596a52fad05018d44468b58b464580a32ba354a;p=chaz%2Fopenbox diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index a44a8cc6..13f12da5 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -25,12 +25,13 @@ #include "focus_cycle.h" #include "openbox.h" #include "window.h" +#include "event.h" #include "render/render.h" #include #include -#define ICON_SIZE 48 +#define ICON_SIZE 40 #define ICON_HILITE_WIDTH 2 #define ICON_HILITE_MARGIN 1 #define OUTSIDE_BORDER 3 @@ -289,7 +290,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) texth = RrMinHeight(p->a_text); /* find the height of the dialog */ - h = t + b + (icon_rows * ICON_SIZE) + (OUTSIDE_BORDER + texth); + h = t + b + (icon_rows * ICON_SIZE) + (OUTSIDE_BORDER*2 + texth); /* get the position of the text */ textx = l; @@ -404,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); @@ -419,17 +421,37 @@ 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) { + /* 50% opacity */ + gint a = ((*s >> RrDefaultAlphaOffset) & 0xff); + *d = *s - (a << RrDefaultAlphaOffset) + + ((a>>1) << 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); } } /* draw the text */ - p->a_text->texture[0].data.text.justify = RR_JUSTIFY_CENTER; p->a_text->texture[0].data.text.string = newtarget->text; p->a_text->surface.parentx = textx; p->a_text->surface.parenty = texty; @@ -467,6 +489,9 @@ void focus_cycle_popup_hide() popup.mapped = FALSE; + /* kill enter events cause by this unmapping */ + event_ignore_all_queued_enters(); + while(popup.targets) { ObFocusCyclePopupTarget *t = popup.targets->data;