From: "Rodolfo García Peñas (kix)" <k...@kix.es>

The function wIconChangeImageFile mustn't update the icon if
no file is set.

This is a bug. To reproduce it:

1. Right click on dock icon. Select "Settings"
2. Erase the Icon Image contents (set empty)
3. Click "OK" -> Exit, no changes... no?
4. Right click on the same dock icon. Select "Settings"
5. Erase the Icon Image contents (set empty)
6. Click "OK" -> Crash

If wmaker don't crash, watch the file ~/GNUstep/Defaults/WMWindowAttributes,
the default icon ("*" has trash in the name). Probably something is not fine
at wIconUpdate.
---
 src/icon.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index da93679..94d9567 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -376,16 +376,14 @@ Bool wIconChangeImageFile(WIcon * icon, char *file)
        char *path;
        int error = 0;
 
+       if (!file)
+               return True;
+
        if (icon->file_image) {
                RReleaseImage(icon->file_image);
                icon->file_image = NULL;
        }
 
-       if (!file) {
-               wIconUpdate(icon);
-               return True;
-       }
-
        path = FindImage(wPreferences.icon_path, file);
 
        if (path && (image = RLoadImage(scr->rcontext, path, 0))) {
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to