1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

wIconChangeImageFile use set_icon_image_from_image

The function wIconChangeImageFile() now use set_icon_image_from_image()
then:

1. Don't need call unset_icon_image() because the memory is free in the
   function set_icon_image_from_image().
2. After update the icon info, it must set the file name.
3. The pixmap image could be updated.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-04-08 19:40:45 +02:00
committed by Carlos R. Mafra
parent c088aba057
commit c24499f6ad

View File

@@ -362,12 +362,10 @@ Bool wIconChangeImageFile(WIcon *icon, char *file)
/* New image! */ /* New image! */
if (!error && image) { if (!error && image) {
/* Remove the old one */
unset_icon_image(icon);
/* Set the new image */ /* Set the new image */
set_icon_image_from_image(icon, image);
icon->file = wstrdup(path); icon->file = wstrdup(path);
wIconUpdate(icon, image); update_icon_pixmap(icon);
} else { } else {
error = 1; error = 1;
} }