Fri Aug 20 17:28:24 PDT 1999 Michael Jennings <mej@eterm.org>

Fixed a small bug in icon size handling located by Hubert Verstraete
	<hubertv@bigfoot.com>.


SVN revision: 67
This commit is contained in:
Michael Jennings 1999-08-21 00:30:06 +00:00
parent 58a51fe10e
commit dcce6f471c
2 changed files with 17 additions and 3 deletions

View File

@ -2324,3 +2324,9 @@ Fri Aug 20 16:05:59 PDT 1999 Michael Jennings <mej@eterm.org>
line should no longer generate a parse error. =)
-------------------------------------------------------------------------------
Fri Aug 20 17:28:24 PDT 1999 Michael Jennings <mej@eterm.org>
Fixed a small bug in icon size handling located by Hubert Verstraete
<hubertv@bigfoot.com>.
-------------------------------------------------------------------------------

View File

@ -1109,7 +1109,7 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
if (icon_path != NULL) {
XIconSize *icon_sizes;
int count, i, w = 64, h = 64;
int count, i, w = 8, h = 8; /* At least 8x8 */
temp_im = Imlib_load_image(imlib_id, (char *) icon_path);
/* 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. */
@ -1117,12 +1117,20 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
for (i = 0; i < count; i++) {
D_PIXMAP(("Got icon sizes: Width %d to %d +/- %d, Height %d to %d +/- %d\n", icon_sizes[i].min_width, icon_sizes[i].max_width,
icon_sizes[i].width_inc, icon_sizes[i].min_height, icon_sizes[i].max_height, icon_sizes[i].height_inc));
w = MIN(icon_sizes[i].max_width, 64); /* 64x64 is plenty big */
h = MIN(icon_sizes[i].max_height, 64);
if (icon_sizes[i].max_width > 64 || icon_sizes[i].max_height > 64) {
continue;
}
/* Find the largest supported size <= 64 */
w = MAX(icon_sizes[i].max_width, w);
h = MAX(icon_sizes[i].max_height, h);
}
fflush(stdout);
XFree(icon_sizes);
} else {
w = h = 48;
}
MIN_IT(w, 64);
MIN_IT(h, 64);
Imlib_render(imlib_id, temp_im, w, h);
wm_hints->icon_pixmap = Imlib_copy_image(imlib_id, temp_im);
wm_hints->icon_mask = Imlib_copy_mask(imlib_id, temp_im);