]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus_cycle_popup.c
set the alpha based on iconicness
[chaz/openbox] / openbox / focus_cycle_popup.c
index bce7e5c87d7eec72f28be02fd7bed74ae53f749c..7d132b6ab55298f822104d59da82d131955f12e3 100644 (file)
 #include "focus_cycle.h"
 #include "openbox.h"
 #include "window.h"
+#include "event.h"
 #include "render/render.h"
 
 #include <X11/Xlib.h>
 #include <glib.h>
 
-#define ICON_SIZE 48
+#define ICON_SIZE 40
 #define ICON_HILITE_WIDTH 2
 #define ICON_HILITE_MARGIN 1
 #define OUTSIDE_BORDER 3
@@ -320,6 +321,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
         /* set up the hilite texture for the background */
         p->a_bg->texture[0].data.rgba.width = rgbaw;
         p->a_bg->texture[0].data.rgba.height = rgbah;
+        p->a_bg->texture[0].data.rgba.alpha = 0xff;
         p->hilite_rgba = g_new(RrPixel32, rgbaw * rgbah);
         p->a_bg->texture[0].data.rgba.data = p->hilite_rgba;
 
@@ -404,6 +406,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,12 +422,20 @@ 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;
+            if (target->client->iconic)
+                /* 7/16 alpha */
+                p->a_icon->texture[0].data.rgba.alpha = (0xff>>1 - 0xff>>4);
+            else
+                p->a_icon->texture[0].data.rgba.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);
+
+            if (target->client->iconic)
+                g_free(icon_data);
         }
     }
 
@@ -466,6 +477,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;
 
This page took 0.029188 seconds and 4 git commands to generate.