1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00

wIconChangeTitle rewrited

The function wIconChangeTitle() function calls wIconUpdate() or
wIconPaint() depending of changed. In both cases the icon->file_image
doesn't change, only the icon title, so we can use the same image
and we don't need update it. Because the variable changed is removed,
we can use wIconPaint() here.

Then the variable changed is not used, and these lines can be removed.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-04-08 19:40:50 +02:00
committed by Carlos R. Mafra
parent ca86f5594d
commit 883ed8ac9a

View File

@@ -303,20 +303,11 @@ static void icon_update_pixmap(WIcon *icon, RImage *image)
void wIconChangeTitle(WIcon *icon, char *new_title)
{
int changed;
changed = (new_title == NULL && icon->icon_name != NULL) ||
(new_title != NULL && icon->icon_name == NULL);
if (icon->icon_name != NULL)
XFree(icon->icon_name);
icon->icon_name = new_title;
if (changed)
wIconUpdate(icon);
else
wIconPaint(icon);
wIconPaint(icon);
}
RImage *wIconValidateIconSize(RImage *icon, int max_size)