… | |
… | |
168 | XFreePixmap (display->display, TermWin.pixmap); |
168 | XFreePixmap (display->display, TermWin.pixmap); |
169 | |
169 | |
170 | if (bgPixmap.pixmap == None) |
170 | if (bgPixmap.pixmap == None) |
171 | { /* So be it: I'm not using pixmaps */ |
171 | { /* So be it: I'm not using pixmaps */ |
172 | TermWin.pixmap = None; |
172 | TermWin.pixmap = None; |
|
|
173 | |
173 | if (! (options & Opt_transparent) || am_transparent == 0) |
174 | if (!(options & Opt_transparent) || !am_transparent) |
174 | XSetWindowBackground (display->display, TermWin.vt, |
175 | XSetWindowBackground (display->display, TermWin.vt, |
175 | pix_colors[Color_bg]); |
176 | pix_colors[Color_bg]); |
|
|
177 | |
176 | return; |
178 | return; |
177 | } |
179 | } |
178 | |
180 | |
179 | gcvalue.foreground = pix_colors[Color_bg]; |
181 | gcvalue.foreground = pix_colors[Color_bg]; |
180 | gc = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
182 | gc = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
181 | |
183 | |
182 | if (bgPixmap.pixmap != None) |
184 | if (bgPixmap.pixmap != None) |
183 | { /* we have a specified pixmap */ |
185 | { /* we have a specified pixmap */ |
184 | unsigned int w = bgPixmap.w, h = bgPixmap.h, |
186 | unsigned int w = bgPixmap.w, h = bgPixmap.h, |
185 | x = bgPixmap.x, y = bgPixmap.y; |
187 | x = bgPixmap.x, y = bgPixmap.y; |
186 | unsigned int xpmh = xpmAttr.height, |
188 | unsigned int xpmh = xpmAttr.height, |
187 | xpmw = xpmAttr.width; |
189 | xpmw = xpmAttr.width; |
188 | |
190 | |
189 | /* |
191 | /* |
190 | * don't zoom pixmap too much nor expand really small pixmaps |
192 | * don't zoom pixmap too much nor expand really small pixmaps |
191 | */ |
193 | */ |
192 | if (w > 1000 || h > 1000) |
194 | if (w > 1000 || h > 1000) |
… | |
… | |
235 | * vertical scaling |
237 | * vertical scaling |
236 | */ |
238 | */ |
237 | rxvt_pixmap_incr (&h, &y, &incr, &p, height, xpmh); |
239 | rxvt_pixmap_incr (&h, &y, &incr, &p, height, xpmh); |
238 | |
240 | |
239 | if (y > 0) |
241 | if (y > 0) |
240 | XFillRectangle (display->display, TermWin.pixmap, gc, 0, 0, width, |
242 | XFillRectangle (display->display, TermWin.pixmap, gc, 0, 0, width, y); |
241 | y); |
243 | |
242 | if (h < height) |
244 | if (h < height) |
243 | XFillRectangle (display->display, TermWin.pixmap, gc, 0, (int)h, |
245 | XFillRectangle (display->display, TermWin.pixmap, gc, 0, (int)h, width, height - h + 1); |
244 | width, height - h + 1); |
246 | |
245 | for ( /*nil */ ; y < h; y++, p += incr) |
247 | for ( /*nil */ ; y < h; y++, p += incr) |
246 | { |
248 | { |
247 | if (p >= xpmh) |
249 | if (p >= xpmh) |
248 | p = 0; |
250 | p = 0; |
|
|
251 | |
249 | /* copy one row from the tmp pixmap to the main pixmap */ |
252 | /* copy one row from the tmp pixmap to the main pixmap */ |
250 | XCopyArea (display->display, tmp, TermWin.pixmap, gc, |
253 | XCopyArea (display->display, tmp, TermWin.pixmap, gc, |
251 | 0, (int)p, width, 1, 0, (int)y); |
254 | 0, (int)p, width, 1, 0, (int)y); |
252 | } |
255 | } |
|
|
256 | |
253 | XFreePixmap (display->display, tmp); |
257 | XFreePixmap (display->display, tmp); |
254 | } |
258 | } |
255 | } |
259 | } |
256 | |
260 | |
257 | XSetWindowBackgroundPixmap (display->display, TermWin.vt, TermWin.pixmap); |
261 | XSetWindowBackgroundPixmap (display->display, TermWin.vt, TermWin.pixmap); |
258 | XFreeGC (display->display, gc); |
262 | XFreeGC (display->display, gc); |
259 | am_transparent = 0; |
263 | am_transparent = 0; |
260 | |
|
|
261 | XClearWindow (display->display, TermWin.vt); |
|
|
262 | |
|
|
263 | XSync (display->display, False); |
|
|
264 | } |
264 | } |
265 | |
265 | |
266 | /* |
266 | /* |
267 | * Calculate tiling sizes and increments |
267 | * Calculate tiling sizes and increments |
268 | * At start, p == 0, incr == xpmwidthheight |
268 | * At start, p == 0, incr == xpmwidthheight |
… | |
… | |
350 | if (bgPixmap.pixmap != None) |
350 | if (bgPixmap.pixmap != None) |
351 | { |
351 | { |
352 | XFreePixmap (display->display, bgPixmap.pixmap); |
352 | XFreePixmap (display->display, bgPixmap.pixmap); |
353 | bgPixmap.pixmap = None; |
353 | bgPixmap.pixmap = None; |
354 | } |
354 | } |
|
|
355 | |
355 | XSetWindowBackground (display->display, TermWin.vt, pix_colors[Color_bg]); |
356 | XSetWindowBackground (display->display, TermWin.vt, pix_colors[Color_bg]); |
356 | |
357 | |
357 | if (*file != '\0') |
358 | if (*file != '\0') |
358 | { |
359 | { |
359 | /* XWindowAttributes attr; */ |
360 | /* XWindowAttributes attr; */ |
… | |
… | |
381 | |
382 | |
382 | /* semi-colon delimited */ |
383 | /* semi-colon delimited */ |
383 | if ((p = strchr (file, ';')) == NULL) |
384 | if ((p = strchr (file, ';')) == NULL) |
384 | p = strchr (file, '\0'); |
385 | p = strchr (file, '\0'); |
385 | |
386 | |
386 | rxvt_warn ("couldn't load XPM file \"%.*s\", ignoring.", (p - file), file); |
387 | rxvt_warn ("couldn't load XPM file \"%.*s\", ignoring.\n", (p - file), file); |
387 | } |
388 | } |
388 | |
389 | |
389 | free (f); |
390 | free (f); |
390 | } |
391 | } |
391 | |
392 | |