mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 05:48:01 +01:00
extractIcon removed.
The function extractIcon is removed, and its behaviour is moved to save_app_icon, because this function is always called. To do that, save_app_icon doesn't need to check if the icon is saved (it's done at wIconStore). The icon now is saved always (if it doesn't exist), like extractIcon() used to do.
This commit is contained in:
committed by
Carlos R. Mafra
parent
bc0700e016
commit
1fbce07805
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user