… | |
… | |
42 | |
42 | |
43 | bool |
43 | bool |
44 | rxvt_term::bg_window_size_sensitive () |
44 | rxvt_term::bg_window_size_sensitive () |
45 | { |
45 | { |
46 | # if BG_IMAGE_FROM_ROOT |
46 | # if BG_IMAGE_FROM_ROOT |
47 | if (option (Opt_transparent)) |
47 | if (root_img) |
48 | return true; |
48 | return true; |
49 | # endif |
49 | # endif |
50 | |
50 | |
51 | # if BG_IMAGE_FROM_FILE |
51 | # if BG_IMAGE_FROM_FILE |
52 | if (fimage.img) |
52 | if (fimage.img) |
… | |
… | |
63 | |
63 | |
64 | bool |
64 | bool |
65 | rxvt_term::bg_window_position_sensitive () |
65 | rxvt_term::bg_window_position_sensitive () |
66 | { |
66 | { |
67 | # if BG_IMAGE_FROM_ROOT |
67 | # if BG_IMAGE_FROM_ROOT |
68 | if (option (Opt_transparent)) |
68 | if (root_img) |
69 | return true; |
69 | return true; |
70 | # endif |
70 | # endif |
71 | |
71 | |
72 | # if BG_IMAGE_FROM_FILE |
72 | # if BG_IMAGE_FROM_FILE |
73 | if (fimage.img) |
73 | if (fimage.img) |
… | |
… | |
315 | img->repeat_mode (RepeatNormal); |
315 | img->repeat_mode (RepeatNormal); |
316 | else |
316 | else |
317 | img->repeat_mode (RepeatNone); |
317 | img->repeat_mode (RepeatNone); |
318 | img->sub_rect (-x, -y, parent_width, parent_height)->replace (img); |
318 | img->sub_rect (-x, -y, parent_width, parent_height)->replace (img); |
319 | |
319 | |
320 | if (bg_flags & BG_IS_VALID) |
320 | if (bg_img) |
321 | img->draw (bg_img, PictOpOver, image.alpha * 1. / 0xffff); |
321 | img->draw (bg_img, PictOpOver, image.alpha * 1. / 0xffff); |
322 | |
322 | |
323 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
323 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
324 | img->convert_format (format, pix_colors [Color_bg])->replace (img); |
324 | img->convert_format (format, pix_colors [Color_bg])->replace (img); |
325 | |
325 | |
… | |
… | |
456 | int sx, sy; |
456 | int sx, sy; |
457 | |
457 | |
458 | sx = parent_x; |
458 | sx = parent_x; |
459 | sy = parent_y; |
459 | sy = parent_y; |
460 | |
460 | |
461 | if (!root_img) |
|
|
462 | return false; |
|
|
463 | |
|
|
464 | /* check if we are outside of the visible part of the virtual screen : */ |
461 | /* check if we are outside of the visible part of the virtual screen : */ |
465 | if (sx + parent_width <= 0 || sy + parent_height <= 0 |
462 | if (sx + parent_width <= 0 || sy + parent_height <= 0 |
466 | || sx >= root_width || sy >= root_height) |
463 | || sx >= root_width || sy >= root_height) |
467 | return 0; |
464 | return 0; |
468 | |
465 | |
… | |
… | |
498 | rxvt_term::bg_render () |
495 | rxvt_term::bg_render () |
499 | { |
496 | { |
500 | if (bg_flags & BG_INHIBIT_RENDER) |
497 | if (bg_flags & BG_INHIBIT_RENDER) |
501 | return; |
498 | return; |
502 | |
499 | |
503 | bg_invalidate (); |
500 | delete bg_img; |
|
|
501 | bg_img = 0; |
|
|
502 | bg_flags = 0; |
|
|
503 | |
|
|
504 | if (!mapped) |
|
|
505 | return; |
|
|
506 | |
504 | # if BG_IMAGE_FROM_ROOT |
507 | # if BG_IMAGE_FROM_ROOT |
505 | if (option (Opt_transparent)) |
508 | if (root_img) |
506 | { |
|
|
507 | /* we need to re-generate transparency pixmap in that case ! */ |
|
|
508 | if (render_root_image ()) |
509 | if (render_root_image ()) |
509 | bg_flags |= BG_IS_VALID | BG_IS_TRANSPARENT; |
510 | bg_flags |= BG_IS_TRANSPARENT; |
510 | } |
|
|
511 | # endif |
511 | # endif |
512 | |
512 | |
513 | # if BG_IMAGE_FROM_FILE |
513 | # if BG_IMAGE_FROM_FILE |
514 | if (fimage.img) |
514 | if (fimage.img) |
515 | { |
|
|
516 | if (render_image (fimage)) |
515 | render_image (fimage); |
517 | bg_flags |= BG_IS_VALID; |
|
|
518 | } |
|
|
519 | # endif |
516 | # endif |
520 | |
|
|
521 | if (!(bg_flags & BG_IS_VALID)) |
|
|
522 | { |
|
|
523 | delete bg_img; |
|
|
524 | bg_img = 0; |
|
|
525 | } |
|
|
526 | |
517 | |
527 | scr_recolour (false); |
518 | scr_recolour (false); |
528 | bg_flags |= BG_NEEDS_REFRESH; |
519 | bg_flags |= BG_NEEDS_REFRESH; |
529 | |
520 | |
530 | bg_valid_since = ev::now (); |
521 | bg_valid_since = ev::now (); |