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

The function wClientCheckProperty() updates the icon using the function
updateIconImage() at wmspec.c (no is non static).

The code is the same, with two exceptions:

1. Now updates net_icon_image (window image) too. IMO the old code should do
   it, but it didn't. IMO was a mistake.
2. Now, the code

-                               if (wwin->flags.miniaturized && wwin->icon) {
-                                       wIconUpdate(wwin->icon, NULL);
-                               }

is in wmspec.c

-                               if (wwin->icon) {
-                                       wIconUpdate(wwin->icon, NULL);
-                               }

Really, it old code was wrong, because with the current code, the wwin->icon 
exists
only if the miniwindow exists, therefore, this code (old code)

-                               if (wwin->flags.miniaturized && wwin->icon) {

is "if (1 && 1)" or "if (0 && 0), if the wwin->icon exists is minimized, else,
it doesn't exists.

Therefore, the code is better and solves two issues.
---
 src/client.c |   19 ++++---------------
 src/wmspec.c |    2 +-
 src/wmspec.h |    1 +
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/src/client.c b/src/client.c
index 975adb1..2ae1e48 100644
--- a/src/client.c
+++ b/src/client.c
@@ -477,27 +477,16 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent 
* event)
 
                if (wwin->wm_hints) {
                        /* update icon */
-                       if ((wwin->wm_hints->flags & IconPixmapHint)
-                           || (wwin->wm_hints->flags & IconWindowHint)) {
-                               WApplication *wapp;
-
-                               if (wwin->flags.miniaturized && wwin->icon) {
-                                       wIconUpdate(wwin->icon, NULL);
-                               }
-                               wapp = wApplicationOf(wwin->main_window);
-                               if (wapp && wapp->app_icon) {
-                                       wIconUpdate(wapp->app_icon->icon, NULL);
-                                       wAppIconPaint(wapp->app_icon);
-                               }
-                       }
+                       if ((wwin->wm_hints->flags & IconPixmapHint) ||
+                           (wwin->wm_hints->flags & IconWindowHint))
+                               updateIconImage(wwin);
 
                        if (wwin->wm_hints->flags & UrgencyHint)
                                wwin->flags.urgent = 1;
                        else
                                wwin->flags.urgent = 0;
+
                        
wAppBounceWhileUrgent(wApplicationOf(wwin->main_window));
-               /*} else if (wwin->fake_group!=NULL) {
-                       wwin->group_id = wwin->fake_group->leader; */
                } else {
                        wwin->group_id = None;
                }
diff --git a/src/wmspec.c b/src/wmspec.c
index a261ef9..c0600c5 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -485,7 +485,7 @@ RImage *get_window_image_from_x11(Window window)
        return image;
 }
 
-static void updateIconImage(WWindow *wwin)
+void updateIconImage(WWindow *wwin)
 {
        /* Remove the icon image from X11 */
        if (wwin->net_icon_image)
diff --git a/src/wmspec.h b/src/wmspec.h
index 7fecf67..e0e5adb 100644
--- a/src/wmspec.h
+++ b/src/wmspec.h
@@ -45,6 +45,7 @@ char *wNETWMGetIconName(Window window);
 char *wNETWMGetWindowName(Window window);
 void wNETFrameExtents(WWindow *wwin);
 void wNETCleanupFrameExtents(WWindow *wwin);
+void updateIconImage(WWindow *wwin);
 RImage *get_window_image_from_x11(Window window);
 RImage *get_window_image(WWindow *wwin);
 RImage *get_window_image_def(WWindow *wwin);
-- 
1.7.10.4


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

Reply via email to