]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus_cycle_popup.c
super amazing enter event skipping.
[chaz/openbox] / openbox / focus_cycle_popup.c
index 0ac274dd5f210a10db44370f214eaf1388a59e6f..015330bda32f2be41a9b25b972568f0b360ae349 100644 (file)
@@ -406,7 +406,6 @@ 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);
@@ -422,20 +421,14 @@ 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*7/16;
-            else
-                p->a_icon->texture[0].data.rgba.alpha = 0xff;
+            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);
-
-            if (target->client->iconic)
-                g_free(icon_data);
         }
     }
 
@@ -472,13 +465,16 @@ void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows,
 
 void focus_cycle_popup_hide()
 {
+    gulong ignore_start;
+
+    ignore_start = event_start_ignore_all_enters();
+
     XUnmapWindow(ob_display, popup.bg);
     XFlush(ob_display);
 
-    popup.mapped = FALSE;
+    event_end_ignore_all_enters(ignore_start);
 
-    /* kill enter events cause by this unmapping */
-    event_ignore_all_queued_enters();
+    popup.mapped = FALSE;
 
     while(popup.targets) {
         ObFocusCyclePopupTarget *t = popup.targets->data;
This page took 0.023542 seconds and 4 git commands to generate.