ewmh: introduce and use netwm_icon_delete()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-29 16:44:57 +02:00
parent 1a8467ff28
commit bf209f87bb
3 changed files with 12 additions and 2 deletions

4
ewmh.c
View File

@ -506,6 +506,10 @@ ewmh_check_client_hints(client_t *c)
p_delete(&reply);
}
/** Get NET_WM_ICON.
* \param w The window.
* \return A netwm_icon_t structure which must be deleted after usage.
*/
netwm_icon_t *
ewmh_get_window_icon(xcb_window_t w)
{

7
ewmh.h
View File

@ -31,6 +31,13 @@ typedef struct
unsigned char *image;
} netwm_icon_t;
static inline void
netwm_icon_delete(netwm_icon_t **i)
{
p_delete(&(*i)->image);
p_delete(i);
}
void ewmh_init(int);
void ewmh_update_net_client_list(int);
void ewmh_update_net_numbers_of_desktop(int);

View File

@ -219,8 +219,7 @@ tasklist_draw(draw_context_t *ctx, int screen,
w->area.y,
icon->width, icon->height,
ctx->height, icon->image);
p_delete(&icon->image);
p_delete(&icon);
netwm_icon_delete(&icon);
}
}
else