… | |
… | |
1135 | wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState; |
1135 | wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState; |
1136 | wmHint.window_group = top; |
1136 | wmHint.window_group = top; |
1137 | |
1137 | |
1138 | XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc, |
1138 | XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc, |
1139 | &szHint, &wmHint, &classHint); |
1139 | &szHint, &wmHint, &classHint); |
|
|
1140 | #if ENABLE_EWMH |
|
|
1141 | # ifdef HAVE_AFTERIMAGE |
|
|
1142 | /* |
|
|
1143 | * set up icon hint |
|
|
1144 | * rs [Rs_iconfile] is path to icon, asv has been created in init_resources |
|
|
1145 | */ |
|
|
1146 | if (rs [Rs_iconfile] && asv) |
|
|
1147 | { |
|
|
1148 | ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); |
|
|
1149 | if (im) |
|
|
1150 | { |
|
|
1151 | int w = im->width; |
|
|
1152 | int h = im->height; |
|
|
1153 | long* buffer = (long *)malloc ((2 + w * h) * sizeof (long)); |
|
|
1154 | ASImage *result = scale_asimage (asv, im, |
|
|
1155 | w, h, ASA_ARGB32, |
|
|
1156 | 100, ASIMAGE_QUALITY_DEFAULT); |
|
|
1157 | destroy_asimage (&im); |
|
|
1158 | |
|
|
1159 | if (buffer && result) |
|
|
1160 | { |
|
|
1161 | ARGB32 *asbuf = result->alt.argb32; |
|
|
1162 | buffer [0] = w; |
|
|
1163 | buffer [1] = h; |
|
|
1164 | |
|
|
1165 | for (unsigned int i = 0; i < w * h; ++i) |
|
|
1166 | buffer [i + 2] = asbuf [i]; |
|
|
1167 | |
|
|
1168 | destroy_asimage (&result); |
|
|
1169 | XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
|
|
1170 | PropModeReplace, (const unsigned char*) buffer, 2 + w * h); |
|
|
1171 | free (buffer); |
|
|
1172 | } |
|
|
1173 | else |
|
|
1174 | { |
|
|
1175 | if (!buffer) |
|
|
1176 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
|
|
1177 | |
|
|
1178 | if (!result) |
|
|
1179 | rxvt_warn ("Icon image transformation to ARGB failed, continuing without.\n"); |
|
|
1180 | } |
|
|
1181 | } |
|
|
1182 | else |
|
|
1183 | rxvt_warn ("Loading image icon failed, continuing without.\n"); |
|
|
1184 | } |
|
|
1185 | # endif |
|
|
1186 | #endif |
1140 | |
1187 | |
1141 | #if ENABLE_FRILLS |
1188 | #if ENABLE_FRILLS |
1142 | if (mwmhints.flags) |
1189 | if (mwmhints.flags) |
1143 | XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, |
1190 | XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, |
1144 | PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); |
1191 | PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); |