From: "Rodolfo García Peñas (kix)" <[email protected]>
get_rimage_icon_from_default_icon() needs an screen to return the
default icon.
Is better use the WScreen than the icon, because if we don't have
an icon, we can still get the default icon using only the WScreen.
---
src/icon.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/icon.c b/src/icon.c
index df2f96c..51dcd41 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -63,7 +63,7 @@ static WIcon *icon_create_core(WScreen *scr, int coord_x, int
coord_y);
static void set_dockapp_in_icon(WIcon *icon);
static RImage *get_rimage_icon_from_icon_win(WIcon *icon);
static void get_rimage_icon_from_user_icon(WIcon *icon);
-static RImage *get_rimage_icon_from_default_icon(WIcon *icon);
+static RImage *get_rimage_icon_from_default_icon(WScreen *scr);
static void icon_update_pixmap(WIcon *icon, RImage *image);
static void unset_icon_image(WIcon *icon);
@@ -670,13 +670,11 @@ static void get_rimage_icon_from_user_icon(WIcon *icon)
/* Remove the icon image */
unset_icon_image(icon);
- icon->file_image = get_rimage_icon_from_default_icon(icon);
+ icon->file_image =
get_rimage_icon_from_default_icon(icon->core->screen_ptr);
}
-static RImage *get_rimage_icon_from_default_icon(WIcon *icon)
+static RImage *get_rimage_icon_from_default_icon(WScreen *scr)
{
- WScreen *scr = icon->core->screen_ptr;
-
/* If the icon don't have image, we should use the default image. */
if (!scr->def_icon_rimage)
scr->def_icon_rimage = get_default_image(scr);
@@ -694,7 +692,7 @@ static RImage *get_rimage_icon_from_icon_win(WIcon *icon)
image = get_window_image_from_x11(icon->icon_win);
if (!image)
- image = get_rimage_icon_from_default_icon(icon);
+ image =
get_rimage_icon_from_default_icon(icon->core->screen_ptr);
return image;
}
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].