diff --git a/src/dock.c b/src/dock.c index e27b28ae..3b3313b2 100644 --- a/src/dock.c +++ b/src/dock.c @@ -2425,6 +2425,9 @@ void wDockDetach(WDock *dock, WAppIcon *icon) dock->icon_count--; + /* Remove the Cached Icon */ + remove_cache_icon(icon->icon->file); + /* if the dock is not attached to an application or * the application did not set the appropriate hints yet, * destroy the icon */ @@ -2452,6 +2455,7 @@ void wDockDetach(WDock *dock, WAppIcon *icon) if (wPreferences.auto_arrange_icons) wArrangeIcons(dock->screen_ptr, True); } + if (dock->auto_collapse || dock->auto_raise_lower) clipLeave(dock); } diff --git a/src/icon.c b/src/icon.c index d53f7564..0dbd6acb 100644 --- a/src/icon.c +++ b/src/icon.c @@ -529,6 +529,24 @@ char *wIconStore(WIcon *icon) return filename; } +void remove_cache_icon(char *filename) +{ + char *cachepath; + + if (!filename) + return; + + cachepath = get_icon_cache_path(); + if (!cachepath) + return; + + /* Filename check/parse could be here */ + if (!strncmp(filename, cachepath, strlen(cachepath))) + unlink(filename); + + wfree(cachepath); +} + static void cycleColor(void *data) { WIcon *icon = (WIcon *) data; diff --git a/src/icon.h b/src/icon.h index dbcb2893..cccd7a86 100644 --- a/src/icon.h +++ b/src/icon.h @@ -80,4 +80,5 @@ void wIconSetHighlited(WIcon *icon, Bool flag); void set_icon_image_from_image(WIcon *icon, RImage *image); void set_icon_minipreview(WIcon *icon, RImage *image); +void remove_cache_icon(char *filename); #endif /* WMICON_H_ */