Update icon images before calling wIconUpdate
authorRodolfo García Peñas (kix) <kix@kix.es>
Sat, 10 Nov 2012 19:25:13 +0000 (10 20:25 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 11 Nov 2012 11:59:19 +0000 (11 11:59 +0000)
This patch updates the icon images if needed before calling wIconUpdate.

src/appicon.c
src/dock.c

index 133aabc..8e8c22b 100644 (file)
@@ -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);
        }
 }
index 295f717..6c34377 100644 (file)
@@ -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);
        }