mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +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:
committed by
Carlos R. Mafra
parent
ca86f5594d
commit
883ed8ac9a
@@ -303,19 +303,10 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user