Remove wIconUpdate in tileObserver
The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
because the icon doesn't need to be changed.
Now, the icon pixmap is updated faster.
This change is more difficult to see, this is the explanation:
1. wIconUpdate() updates the icon for the applications, then call
update_icon_pixmap() to re-create the pixmap.
2. tileObserver() is used if the event WNIconTileSettingsChanged() is
launched. This event is used in the Notification for docks and wwindows:
WMAddNotificationObserver(tileObserver, icon, WNIconTileSettingsChanged, icon);
3. The function WNIconTileSettingsChanged() is used if the icon need refresh,
used in the wReadDefaults() function. See code below. This function is used
in the wmaker startup.
if (needs_refresh & REFRESH_ICON_TILE)
WMPostNotificationName(WNIconTileSettingsChanged, NULL, NULL);
4. Finally, the flag to refresh the icon tile is throw by setIconTile():
return (reset ? REFRESH_ICON_TILE : 0);
And this function only changes the the icon tile if reset is "1", that
happend if src->icon_tile:
if (scr->icon_tile) {
reset = 1;
RReleaseImage(scr->icon_tile);
XFreePixmap(dpy, scr->icon_tile_pixmap);
}
5. Then, we can drop the function wIconUpdate(), because the change is in the
icon_tile variable, used only in icon_update_pixmap(). This function is
only used in update_icon_pixmap() (not in wIconUpdate):
kix@kentin:~/src/wmaker/git/wmaker-crm/src$ grep icon_tile icon.c
tile = RCloneImage(scr->icon_tile);
XSetWindowBackgroundPixmap(dpy, icon->core->window, scr->icon_tile_pixmap);
kix@kentin:~/src/wmaker/git/wmaker-crm/src$
static void icon_update_pixmap(WIcon *icon, RImage *image)
{
[snip]
if (icon->tile_type == TILE_NORMAL) {
tile = RCloneImage(scr->icon_tile);
} else {
assert(scr->clip_tile);
tile = RCloneImage(scr->clip_tile);
}
[snip]
The XSetWindowBackgroundPixmap() call doesn't matter here.