From: "Rodolfo García Peñas (kix)" <[email protected]>

This patch updates the icon images if needed before call wIconUpdate.
---
 src/appicon.c |   13 +++++++++++--
 src/dock.c    |   34 ++++++++++++++++++++++++++++++----
 2 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index 133aabc..8e8c22b 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -252,7 +252,12 @@ void removeAppIconFor(WApplication *wapp)
                wapp->app_icon->pid = 0;
                wapp->app_icon->icon->owner = NULL;
                wapp->app_icon->icon->icon_win = None;
-               wAppIconPaint(wapp->app_icon, True);
+
+               /* Update the icon images */
+               wIconUpdate(wapp->app_icon->icon);
+
+               /* Paint it */
+               wAppIconPaint(wapp->app_icon, False);
        } else if (wapp->app_icon->docked) {
                wapp->app_icon->running = 0;
                wDockDetach(wapp->app_icon->dock, wapp->app_icon);
@@ -988,7 +993,11 @@ void create_appicon_from_dock(WWindow *wwin, WApplication 
*wapp, Window main_win
                if (mainw->wm_hints && (mainw->wm_hints->flags & 
IconWindowHint))
                        wapp->app_icon->icon->icon_win = 
mainw->wm_hints->icon_window;
 
-               wAppIconPaint(wapp->app_icon, True);
+               /* Update the icon images */
+               wIconUpdate(wapp->app_icon->icon);
+
+               /* Paint it */
+               wAppIconPaint(wapp->app_icon, False);
                save_appicon(wapp->app_icon, True);
        }
 }
diff --git a/src/dock.c b/src/dock.c
index 295f717..6c34377 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -534,11 +534,17 @@ static void keepIconsCallback(WMenu *menu, WMenuEntry 
*entry)
        WM_ITERATE_ARRAY(selectedIcons, aicon, it) {
                if (aicon->icon->selected)
                        wIconSelect(aicon->icon);
+
                if (aicon && aicon->attracted && aicon->command) {
                        aicon->attracted = 0;
                        if (aicon->icon->shadowed) {
                                aicon->icon->shadowed = 0;
-                               wAppIconPaint(aicon, True);
+
+                               /* Update the icon images */
+                               wIconUpdate(aicon->icon);
+
+                               /* Paint it */
+                               wAppIconPaint(aicon, False);
                        }
                }
                save_appicon(aicon, True);
@@ -1929,7 +1935,15 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, 
int y, Bool update_icon
 
        MoveInStackListUnder(dock->icon_array[index - 1]->icon->core, 
icon->icon->core);
        wAppIconMove(icon, icon->x_pos, icon->y_pos);
-       wAppIconPaint(icon, lupdate_icon);
+
+       /* Update the icon images */
+       if (lupdate_icon)
+               wIconUpdate(icon->icon);
+
+       /* Paint it */
+       wAppIconPaint(icon, False);
+
+       /* Save it */
        save_appicon(icon, True);
 
        if (wPreferences.auto_arrange_icons)
@@ -2072,7 +2086,13 @@ static Bool moveIconBetweenDocks(WDock *src, WDock 
*dest, WAppIcon *icon, int x,
        dest->icon_count++;
 
        MoveInStackListUnder(dest->icon_array[index - 1]->icon->core, 
icon->icon->core);
-       wAppIconPaint(icon, update_icon);
+
+       /* Update the icon images */
+       if (update_icon)
+               wIconUpdate(icon->icon);
+
+       /* Paint it */
+       wAppIconPaint(icon, False);
 
        return True;
 }
@@ -2144,7 +2164,13 @@ void wDockDetach(WDock *dock, WAppIcon *icon)
 
                ChangeStackingLevel(icon->icon->core, NORMAL_ICON_LEVEL);
 
-               wAppIconPaint(icon, update_icon);
+               /* Update the icon images */
+               if (update_icon)
+                       wIconUpdate(icon->icon);
+
+               /* Paint it */
+               wAppIconPaint(icon, False);
+
                if (wPreferences.auto_arrange_icons)
                        wArrangeIcons(dock->screen_ptr, True);
        }
-- 
1.7.10.4


-- 
To unsubscribe, send mail to [email protected].

Reply via email to