The function set_icon_image_from_database should use only the icons
in the database, but don't draw them on the screen. This patch removes
the call to the RLoadImage that maps the image in the screen.

Now, the function onlhy loads the image, but doesn't draw it.
The image is mapped in the functions where is used.

Signed-off-by: Rodolfo García Peñas (kix) <[email protected]>
---
 src/appicon.c | 4 +++-
 src/icon.c    | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index e7e74f1..8cfcf0f 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -273,7 +273,9 @@ void removeAppIconFor(WApplication *wapp)
                /* Set the icon image */
                set_icon_image_from_database(aicon->icon, aicon->wm_instance,
                                             aicon->wm_class, aicon->command);
-               aicon->icon->file_image = 
wIconValidateIconSize(aicon->icon->file_image, wPreferences.icon_size);
+               aicon->icon->file_image = 
RDrawImage(aicon->icon->core->screen_ptr->rcontext,
+                                                    aicon->icon->file_image);
+               aicon->icon->file_image = 
wIconValidateIconSize(aicon->icon->file_image,                                  
                                                   wPreferences.icon_size);
 
                /* Update the icon, because aicon->icon could be NULL */
                wIconUpdate(aicon->icon);
diff --git a/src/icon.c b/src/icon.c
index f4fe86c..adecb48 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -143,6 +143,7 @@ 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);
+       icon->file_image = RDrawImage(scr->rcontext, icon->file_image);
        icon->file_image = wIconValidateIconSize(icon->file_image, 
wPreferences.icon_size);
 
        /* Update the icon, because icon could be NULL */
@@ -164,6 +165,7 @@ WIcon *icon_create_for_dock(WScreen *scr, const char 
*command, const char *wm_in
        icon->tile_type = tile;
 
        set_icon_image_from_database(icon, wm_instance, wm_class, command);
+       icon->file_image = RDrawImage(scr->rcontext, icon->file_image);
        icon->file_image = wIconValidateIconSize(icon->file_image, 
wPreferences.icon_size);
 
        /* Update the icon, because icon could be NULL */
@@ -916,7 +918,7 @@ void set_icon_image_from_database(WIcon *icon, const char 
*wm_instance, const ch
        file = get_icon_filename(wm_instance, wm_class, command, False);
        if (file) {
                icon->file = wstrdup(file);
-               image = RLoadImage(icon->core->screen_ptr->rcontext, 
icon->file, 0);
+               image = RLoadImage_nodraw(icon->file, 0);
                icon->file_image = image;
                if (!image)
                        wwarning(_("error loading image file \"%s\": %s"), 
icon->file,
-- 
1.8.4.rc3


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

Reply via email to