From c97bf1907963cf7b7094c42228d2c4fb008843f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sat, 3 Nov 2012 19:54:05 +0100 Subject: [PATCH] New function update_icon_pixmap The new function update_icon_pixmap() updates the pixmap for a icon task. Now, wIconCreate() creates the image and sets the icon->file and icon->file_image variables and update_icon_pixmap() updates the icon->pixmap. This is interesting because we can update the pixmaps without creating the image again. --- src/icon.c | 5 +++++ src/icon.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/icon.c b/src/icon.c index 38814bff..9aa18c7f 100644 --- a/src/icon.c +++ b/src/icon.c @@ -614,6 +614,11 @@ void wIconUpdate(WIcon *icon) get_rimage_icon_from_user_icon(icon); } + update_icon_pixmap(icon); +} + +void update_icon_pixmap(WIcon *icon) +{ if (icon->pixmap != None) XFreePixmap(dpy, icon->pixmap); diff --git a/src/icon.h b/src/icon.h index f0786cbf..48cf58b7 100644 --- a/src/icon.h +++ b/src/icon.h @@ -62,6 +62,7 @@ void wIconPaint(WIcon *icon); void wIconUpdate(WIcon *icon); void wIconSelect(WIcon *icon); void wIconChangeTitle(WIcon *icon, char *new_title); +void update_icon_pixmap(WIcon *icon); Bool wIconChangeImageFile(WIcon *icon, char *file); -- 2.11.4.GIT