From: Rodolfo García Peñas (kix) Date: Tue, 23 Oct 2012 21:59:59 +0000 (+0200) Subject: New helper function get_pixmap_icon_from_default_icon X-Git-Tag: wmaker-0.95.4~86 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/b8025ee8996009721540c5e866f7993cb938358a 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. --- 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);