From b8025ee8996009721540c5e866f7993cb938358a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Tue, 23 Oct 2012 23:59:59 +0200 Subject: [PATCH] New helper function get_pixmap_icon_from_default_icon 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 791f8fb5..95ab5686 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); -- 2.11.4.GIT