From: "Rodolfo García Peñas (kix)" <[email protected]>
The new helper function get_pixmap_icon_from_default_icon search
the default icon in the disk and return it.
Now get_pixmap_icon_from_user_icon() returns do the work about
search the user icon, and the work about default icon is splitted
in the function get_pixmap_icon_from_user_icon.
---
src/icon.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/icon.c b/src/icon.c
index 791f8fb..95ab568 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -63,6 +63,7 @@ static WIcon *icon_create_core(WScreen *scr, int coord_x, int
coord_y);
static void get_pixmap_icon_from_icon_win(WIcon *icon);
static int get_pixmap_icon_from_wm_hints(WIcon *icon);
static void get_pixmap_icon_from_user_icon(WIcon *icon);
+static void get_pixmap_icon_from_default_icon(WIcon *icon);
static void icon_update_pixmap(WIcon *icon, RImage *image);
@@ -617,14 +618,19 @@ void wIconUpdate(WIcon *icon)
static void get_pixmap_icon_from_user_icon(WIcon *icon)
{
- WScreen *scr = icon->core->screen_ptr;
-
/* If the icon has image, update it and continue */
if (icon->file_image) {
icon_update_pixmap(icon, icon->file_image);
return;
}
+ get_pixmap_icon_from_default_icon(icon);
+}
+
+static void get_pixmap_icon_from_default_icon(WIcon *icon)
+{
+ WScreen *scr = icon->core->screen_ptr;
+
/* If the icon don't have image, we should use the default image. */
if (!scr->def_icon_rimage)
scr->def_icon_rimage = get_default_image(scr);
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].