… | |
… | |
2090 | |
2090 | |
2091 | void |
2091 | void |
2092 | rxvt_term::set_background (rxvt_img *img, bool border = false) |
2092 | rxvt_term::set_background (rxvt_img *img, bool border = false) |
2093 | CODE: |
2093 | CODE: |
2094 | THIS->bg_destroy (); |
2094 | THIS->bg_destroy (); |
2095 | THIS->bg_pixmap = None; |
2095 | THIS->bg_img = 0; |
2096 | THIS->bg_flags &= ~(rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER | rxvt_term::BG_IS_TRANSPARENT); |
2096 | THIS->bg_flags &= ~(rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER | rxvt_term::BG_IS_TRANSPARENT); |
2097 | |
2097 | |
2098 | if (img) // TODO: cannot be false |
2098 | if (img) // TODO: cannot be false |
2099 | { |
2099 | { |
2100 | img = img->clone (); // own the img |
2100 | img = img->clone (); // own the img |
… | |
… | |
2110 | ->replace (img); |
2110 | ->replace (img); |
2111 | |
2111 | |
2112 | img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]) |
2112 | img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]) |
2113 | ->replace (img); |
2113 | ->replace (img); |
2114 | |
2114 | |
2115 | THIS->bg_pixmap = img->steal (); |
2115 | THIS->bg_img = img; |
2116 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; |
2116 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; |
2117 | |
2117 | |
2118 | if (!border) |
2118 | if (!border) |
2119 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
2119 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
2120 | |
2120 | |