… | |
… | |
1158 | ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); |
1158 | ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); |
1159 | if (asv && im) |
1159 | if (asv && im) |
1160 | { |
1160 | { |
1161 | int w = im->width; |
1161 | int w = im->width; |
1162 | int h = im->height; |
1162 | int h = im->height; |
1163 | long* buffer = (long *)malloc ((2 + w * h) * sizeof (long)); |
1163 | long *buffer = (long *)malloc ((2 + w * h) * sizeof (long)); |
1164 | ASImage *result = scale_asimage (asv, im, |
1164 | ASImage *result = scale_asimage (asv, im, |
1165 | w, h, ASA_ARGB32, |
1165 | w, h, ASA_ARGB32, |
1166 | 100, ASIMAGE_QUALITY_DEFAULT); |
1166 | 100, ASIMAGE_QUALITY_DEFAULT); |
1167 | destroy_asimage (&im); |
1167 | destroy_asimage (&im); |
1168 | |
1168 | |
… | |
… | |
1175 | for (unsigned int i = 0; i < w * h; ++i) |
1175 | for (unsigned int i = 0; i < w * h; ++i) |
1176 | buffer [i + 2] = asbuf [i]; |
1176 | buffer [i + 2] = asbuf [i]; |
1177 | |
1177 | |
1178 | destroy_asimage (&result); |
1178 | destroy_asimage (&result); |
1179 | XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1179 | XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1180 | PropModeReplace, (const unsigned char*) buffer, 2 + w * h); |
1180 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1181 | free (buffer); |
1181 | free (buffer); |
1182 | } |
1182 | } |
1183 | else |
1183 | else |
1184 | { |
1184 | { |
1185 | if (!buffer) |
1185 | if (!buffer) |