The function wIconStore() don't write a new file overwriting the
previous icon if the icon file exists.
---
 src/icon.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index 98df353..e7910c7 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -475,6 +475,10 @@ char *wIconStore(WIcon * icon)
        if (!path)
                return NULL;
 
+       /* If icon exists, exit */
+       if (access(path, F_OK) == 0)
+                return path;
+
        if (wwin->net_icon_image) {
                image = RRetainImage(wwin->net_icon_image);
        } else if (wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)
-- 
1.7.9.1

>From ef44d6a60cd5b7a7d69394862c489a7d1e0d2016 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sun, 15 Apr 2012 20:20:29 +0200
Subject: [PATCH 16/16] WindowMaker: wIconStore() don't save the icon if
 exists

The function wIconStore() don't write a new file overwriting the
previous icon if the icon file exists.
---
 src/icon.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index 98df353..e7910c7 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -475,6 +475,10 @@ char *wIconStore(WIcon * icon)
 	if (!path)
 		return NULL;
 
+	/* If icon exists, exit */
+	if (access(path, F_OK) == 0)
+                return path;
+
 	if (wwin->net_icon_image) {
 		image = RRetainImage(wwin->net_icon_image);
 	} else if (wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)
-- 
1.7.9.1

Reply via email to