From 156d8ebfa52a66f2634a3668dcad1b97e9392f02 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Wed, 31 Oct 2012 22:44:17 +0100 Subject: [PATCH] wIconChangeImageFile don't update without file 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 da93679c..94d95670 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))) { -- 2.11.4.GIT