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

The function set_icon_image_from_database() set the icon from the
database, but wIconUpdate() update the icon using different methods
, like for example get the image from X11. So, is better move the
wIconUpdate() to the function who call set_icon_image_from_database(),
to avoid understanding problems.
---
 src/appicon.c |    3 +++
 src/icon.c    |    6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index 117fddb..b196931 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -266,6 +266,9 @@ void removeAppIconFor(WApplication *wapp)
                set_icon_image_from_database(wapp->app_icon->icon, 
wapp->app_icon->wm_instance,
                                             wapp->app_icon->wm_class, 
wapp->app_icon->command);
 
+               /* Update the icon, because wapp->app_icon->icon could be NULL 
*/
+               wIconUpdate(wapp->app_icon->icon);
+
                /* Paint it */
                wAppIconPaint(wapp->app_icon);
        } else if (wapp->app_icon->docked) {
diff --git a/src/icon.c b/src/icon.c
index c6d744c..d5f857c 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -143,6 +143,8 @@ WIcon *icon_create_for_wwindow(WWindow *wwin)
        icon->tile_type = TILE_NORMAL;
 
        set_icon_image_from_database(icon, wwin->wm_instance, wwin->wm_class, 
NULL);
+       /* Update the icon, because icon could be NULL */
+       wIconUpdate(icon);
 
        WMAddNotificationObserver(appearanceObserver, icon, 
WNIconAppearanceSettingsChanged, icon);
        WMAddNotificationObserver(tileObserver, icon, 
WNIconTileSettingsChanged, icon);
@@ -158,6 +160,8 @@ WIcon *icon_create_for_dock(WScreen *scr, char *command, 
char *wm_instance, char
        icon->tile_type = tile;
 
        set_icon_image_from_database(icon, wm_instance, wm_class, command);
+       /* Update the icon, because icon could be NULL */
+       wIconUpdate(icon);
 
        WMAddNotificationObserver(appearanceObserver, icon, 
WNIconAppearanceSettingsChanged, icon);
        WMAddNotificationObserver(tileObserver, icon, 
WNIconTileSettingsChanged, icon);
@@ -885,6 +889,4 @@ void set_icon_image_from_database(WIcon *icon, char 
*wm_instance, char *wm_class
                icon->file_image = get_rimage_from_file(icon->core->screen_ptr, 
icon->file, wPreferences.icon_size);
                wfree(file);
        }
-
-       wIconUpdate(icon);
 }
-- 
1.7.10.4


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

Reply via email to