ewmh: introduce and use netwm_icon_delete()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
1a8467ff28
commit
bf209f87bb
4
ewmh.c
4
ewmh.c
|
@ -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
7
ewmh.h
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue