Mon Feb 4 21:13:44 2002 Michael Jennings (mej)
Finally got around to fixing the icon loader.... SVN revision: 5899
This commit is contained in:
parent
1ece1388ff
commit
17646c4170
|
@ -4483,3 +4483,7 @@ Sun Feb 3 15:51:38 2002 Michael Jennings (mej)
|
|||
|
||||
Apparently I forgot to commit these copyright date changes. :(
|
||||
----------------------------------------------------------------------
|
||||
Mon Feb 4 21:13:44 2002 Michael Jennings (mej)
|
||||
|
||||
Finally got around to fixing the icon loader....
|
||||
----------------------------------------------------------------------
|
||||
|
|
13
src/pixmap.c
13
src/pixmap.c
|
@ -2052,6 +2052,7 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
|
|||
{
|
||||
const char *icon_path;
|
||||
Imlib_Image temp_im = (Imlib_Image) NULL;
|
||||
Imlib_Load_Error im_err;
|
||||
XWMHints *wm_hints;
|
||||
int w = 8, h = 8;
|
||||
|
||||
|
@ -2069,7 +2070,10 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
|
|||
XIconSize *icon_sizes;
|
||||
int count, i;
|
||||
|
||||
temp_im = imlib_load_image(icon_path);
|
||||
temp_im = imlib_load_image_with_error_return(f, &im_err);
|
||||
if (temp_im == NULL) {
|
||||
print_error("Unable to load icon file \"%s\" -- %s\n", filename, imlib_strerror(im_err));
|
||||
} else {
|
||||
/* If we're going to render the image anyway, might as well be nice and give it to the WM in a size it likes. */
|
||||
if (XGetIconSizes(Xdisplay, Xroot, &icon_sizes, &count)) {
|
||||
for (i = 0; i < count; i++) {
|
||||
|
@ -2089,9 +2093,12 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
|
|||
}
|
||||
BOUND(w, 8, 64);
|
||||
BOUND(h, 8, 64);
|
||||
}
|
||||
imlib_context_set_image(temp_im);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (temp_im == NULL) {
|
||||
w = h = 48;
|
||||
temp_im = imlib_create_image_using_data(48, 48, (DATA32 *) icon_data);
|
||||
imlib_context_set_image(temp_im);
|
||||
|
|
Loading…
Reference in New Issue