diff --git a/src/defaults.c b/src/defaults.c index 4bf9affe..458093c5 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -2381,18 +2381,14 @@ static int setIconTile(WScreen * scr, WDefaultEntry * entry, WTexture ** texture scr->icon_tile_pixmap = pixmap; - if (scr->def_icon_pixmap) { - XFreePixmap(dpy, scr->def_icon_pixmap); - scr->def_icon_pixmap = None; - } - if (scr->def_ticon_pixmap) { - XFreePixmap(dpy, scr->def_ticon_pixmap); - scr->def_ticon_pixmap = None; + if (scr->def_icon_rimage) { + RReleaseImage(scr->def_icon_rimage); + scr->def_icon_rimage = NULL; } - if (scr->icon_back_texture) { + if (scr->icon_back_texture) wTextureDestroy(scr, (WTexture *) scr->icon_back_texture); - } + scr->icon_back_texture = wTextureMakeSolid(scr, &((*texture)->any.color)); if (scr->clip_balloon) diff --git a/src/icon.c b/src/icon.c index 2739ca19..b0da0d8d 100644 --- a/src/icon.c +++ b/src/icon.c @@ -628,28 +628,20 @@ void wIconUpdate(WIcon *icon) static void get_pixmap_icon_from_user_icon(WIcon *icon) { - RImage *image = NULL; WScreen *scr = icon->core->screen_ptr; + /* If the icon has image, update it and continue */ if (icon->file_image) { icon_update_pixmap(icon, icon->file_image); - } else { - /* make default icons */ - if (!scr->def_icon_pixmap) { - image = get_default_image(scr); - scr->def_icon_pixmap = makeIcon(scr, image, False, False, icon->tile_type, icon->highlighted); - scr->def_ticon_pixmap = makeIcon(scr, image, True, False, icon->tile_type, icon->highlighted); - if (image) - RReleaseImage(image); - } - - if (icon->show_title) - XSetWindowBackgroundPixmap(dpy, icon->core->window, scr->def_ticon_pixmap); - else - XSetWindowBackgroundPixmap(dpy, icon->core->window, scr->def_icon_pixmap); - - icon->pixmap = None; + return; } + + /* 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); + + /* Now, create the pixmap using the default (saved) image */ + icon_update_pixmap(icon, scr->def_icon_rimage); } /* This function creates the RImage using the default icon */ diff --git a/src/screen.h b/src/screen.h index f0210963..dfdbd636 100644 --- a/src/screen.h +++ b/src/screen.h @@ -229,14 +229,13 @@ typedef struct _WScreen { struct RImage *icon_tile; struct RImage *clip_tile; - Pixmap icon_tile_pixmap; /* for app supplied icons */ - Pixmap def_icon_pixmap; /* default icons */ - Pixmap def_ticon_pixmap; + Pixmap icon_tile_pixmap; /* For app supplied icons */ + + struct RImage *def_icon_rimage; /* Default RImage icon */ struct WDialogData *dialog_data; - struct W_GeometryView *gview; /* size/position view */ /* state and other informations */