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

The function wIconUpdate reads the icon from the client's window
icon image. This was set previously in wwin->net_icon_image by
get_window_image(), and this function is used always the icon change.
So, wwin->net_icon_image has always the icon image provided by the
client, except if the client doesn't provide image, then is NULL.

The function get_window_image_def() provides the net_icon_image, but
if is NULL, then provides the default icon image.
---
 src/icon.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index 6ef8474..e8ec87f 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -613,19 +613,18 @@ void wIconUpdate(WIcon *icon, RImage *image)
 
                        /* Get the Pixmap from the WIcon's Window */
                        icon->file_image = get_rimage_icon_from_icon_win(icon);
-               } else if (wwin && wwin->net_icon_image) {
+               } else if ((wwin && wwin->net_icon_image) ||
+                          ((wwin && wwin->wm_hints &&
+                           (wwin->wm_hints->flags & IconPixmapHint)))) {
                        /* Remove the icon image */
                        unset_icon_image(icon);
 
-                       /* Set the new icon image, use _NET_WM_ICON icon
-                        * (same icon that the window) */
-                       icon->file_image = RRetainImage(wwin->net_icon_image);
-               } else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags & 
IconPixmapHint)) {
-                       /* Get the Pixmap from the wm_hints, else, from the 
user */
-                       unset_icon_image(icon);
-                       icon->file_image = get_rimage_icon_from_wm_hints(wwin);
-                       if (!icon->file_image)
-                               get_rimage_icon_from_user_icon(icon);
+                       /* Get the icon from wwin->net_icon_image.
+                        * wwin->net_icon_image is NULL only if no icon was
+                        * found. Then, the second part of the if is always
+                        * false '((wwin && wwin->wm_hints &&
+                        *  (wwin->wm_hints->flags & IconPixmapHint))' */
+                       icon->file_image = get_window_image_def(wwin);
                } else {
                        /* Get the Pixmap from the user */
                        get_rimage_icon_from_user_icon(icon);
-- 
1.7.10.4


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

Reply via email to