diff --git a/src/appicon.c b/src/appicon.c index b46bf72c..9201f8d1 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -929,34 +929,14 @@ void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance, char *wm_cla UpdateDomainFile(WDWindowAttributes); } +/* Save the application icon */ +/* This function is used by normal windows */ void save_app_icon(WWindow *wwin, WApplication *wapp) { - char *tmp, *path; - struct stat dummy; - WScreen *scr = NULL; - if (!wapp->app_icon) return; - scr = wwin->screen_ptr; - tmp = wDefaultGetIconFile(scr, wapp->app_icon->wm_instance, wapp->app_icon->wm_class, True); - - /* If the icon was saved by us from the client supplied icon, but is - * missing, recreate it. */ - if (tmp && strstr(tmp, "Library/WindowMaker/CachedPixmaps") != NULL && - stat(tmp, &dummy) != 0 && errno == ENOENT) { - wmessage(_("recreating missing icon '%s'"), tmp); - path = wIconStore(wapp->app_icon->icon); - if (path) - wfree(path); - - wIconUpdate(wapp->app_icon->icon); - wAppIconPaint(wapp->app_icon); - } - - /* if the displayed icon was supplied by the client, save the icon */ - if (!tmp || strstr(tmp, "Library/WindowMaker/CachedPixmaps") != NULL) - wAppIconSave(wapp->app_icon); + save_app_icon_core(wapp->app_icon); } static WAppIcon *findDockIconFor(WDock *dock, Window main_window) diff --git a/src/application.c b/src/application.c index f29e90fc..dee6fccf 100644 --- a/src/application.c +++ b/src/application.c @@ -77,19 +77,6 @@ WApplication *wApplicationOf(Window window) return wapp; } -static void extractIcon(WWindow * wwin) -{ - char *progname; - - /* Get the application name */ - progname = GetProgramNameForWindow(wwin->client_win); - if (progname) { - /* Save the icon path if the application is ".app" */ - wApplicationExtractDirPackIcon(wwin->screen_ptr, progname, wwin->wm_instance, wwin->wm_class); - wfree(progname); - } -} - WApplication *wApplicationCreate(WWindow * wwin) { WScreen *scr = wwin->screen_ptr; @@ -137,8 +124,6 @@ WApplication *wApplicationCreate(WWindow * wwin) wapp->main_window_desc->fake_group = wwin->fake_group; wapp->main_window_desc->net_icon_image = RRetainImage(wwin->net_icon_image); - extractIcon(wapp->main_window_desc); - leader = wWindowFor(main_window); if (leader) leader->main_window = main_window;