1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 13:28:05 +01:00

wIconCreate: get the icon file name first

The function wIconCreate search the icon image calling wDefaultGetIconFile.
wDefaultGetIconFile search first the icon file name and then search the
image using the icon file name. wDefaultGetIconFile returns the icon image
to wIconCreate, then wIconCreate search the file name (again).

Is better that wIconCreate search first the file name, and then get
the image using the file name.
This commit is contained in:
Rodolfo García Peñas (kix)
2012-10-01 23:19:01 +02:00
committed by Carlos R. Mafra
parent da5e2f8a0d
commit 236c1c5f70

View File

@@ -101,7 +101,7 @@ INLINE static void getSize(Drawable d, unsigned int *w, unsigned int *h, unsigne
XGetGeometry(dpy, d, &rjunk, &xjunk, &yjunk, w, h, &bjunk, dep);
}
WIcon *wIconCreate(WWindow * wwin)
WIcon *wIconCreate(WWindow *wwin)
{
WScreen *scr = wwin->screen_ptr;
WIcon *icon;
@@ -126,12 +126,13 @@ WIcon *wIconCreate(WWindow * wwin)
#else
icon->show_title = 1;
#endif
icon->file_image = wDefaultGetImage(scr, wwin->wm_instance, wwin->wm_class, wPreferences.icon_size);
/* Get the application icon, default included */
file = wDefaultGetIconFile(wwin->wm_instance, wwin->wm_class, True);
if (file)
file = get_default_icon_filename(scr, wwin->wm_instance, wwin->wm_class, NULL, True);
if (file) {
icon->file = wstrdup(file);
icon->file_image = get_default_icon_rimage(scr, icon->file, wPreferences.icon_size);
}
icon->icon_name = wNETWMGetIconName(wwin->client_win);
if (icon->icon_name)
@@ -206,6 +207,10 @@ static WIcon *wIconCreateCore(WScreen *scr, int coord_x, int coord_y)
icon->core->stacking->window_level = NORMAL_ICON_LEVEL;
icon->core->stacking->child_of = NULL;
/* Icon image */
icon->file = NULL;
icon->file_image = NULL;
return icon;
}