1 | /*----------------------------------------------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: background.C - former xpm.C |
2 | * File: background.C |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 2005-2008 Marc Lehmann <schmorp@schmorp.de> |
6 | * Copyright (c) 2005-2008 Marc Lehmann <schmorp@schmorp.de> |
7 | * Copyright (c) 2007 Sasha Vasko <sasha@aftercode.net> |
7 | * Copyright (c) 2007 Sasha Vasko <sasha@aftercode.net> |
… | |
… | |
319 | else |
319 | else |
320 | img->repeat_mode (RepeatNone); |
320 | img->repeat_mode (RepeatNone); |
321 | img->sub_rect (-x, -y, parent_width, parent_height)->replace (img); |
321 | img->sub_rect (-x, -y, parent_width, parent_height)->replace (img); |
322 | |
322 | |
323 | if (bg_flags & BG_IS_VALID) |
323 | if (bg_flags & BG_IS_VALID) |
324 | { |
324 | img->draw (bg_img, PictOpOver, image.alpha * 1. / 0xffff); |
325 | double factor = image.alpha * 1. / 0xffff; |
|
|
326 | bg_img->blend (img, factor)->replace (img); |
|
|
327 | } |
|
|
328 | |
325 | |
329 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
326 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
330 | img->convert_format (format, pix_colors [Color_bg])->replace (img); |
327 | img->convert_format (format, pix_colors [Color_bg])->replace (img); |
331 | |
328 | |
332 | delete bg_img; |
329 | delete bg_img; |
… | |
… | |
537 | } |
534 | } |
538 | |
535 | |
539 | void |
536 | void |
540 | rxvt_term::bg_init () |
537 | rxvt_term::bg_init () |
541 | { |
538 | { |
|
|
539 | #if ENABLE_TRANSPARENCY |
|
|
540 | if (option (Opt_transparent)) |
|
|
541 | { |
|
|
542 | bg_set_transparent (); |
|
|
543 | |
|
|
544 | if (rs [Rs_blurradius]) |
|
|
545 | root_effects.set_blur (rs [Rs_blurradius]); |
|
|
546 | |
|
|
547 | if (ISSET_PIXCOLOR (Color_tint)) |
|
|
548 | root_effects.set_tint (pix_colors_focused [Color_tint]); |
|
|
549 | |
|
|
550 | if (rs [Rs_shade]) |
|
|
551 | root_effects.set_shade (rs [Rs_shade]); |
|
|
552 | |
|
|
553 | bg_set_root_pixmap (); |
|
|
554 | XSelectInput (dpy, display->root, PropertyChangeMask); |
|
|
555 | rootwin_ev.start (display, display->root); |
|
|
556 | } |
|
|
557 | #endif |
|
|
558 | |
542 | #if BG_IMAGE_FROM_FILE |
559 | #if BG_IMAGE_FROM_FILE |
543 | if (rs[Rs_backgroundPixmap]) |
560 | if (rs[Rs_backgroundPixmap]) |
544 | { |
561 | { |
545 | fimage.set_file_geometry (this, rs[Rs_backgroundPixmap]); |
562 | fimage.set_file_geometry (this, rs[Rs_backgroundPixmap]); |
546 | if (!bg_window_position_sensitive ()) |
563 | if (!bg_window_position_sensitive ()) |