--- rxvt-unicode/src/rxvtperl.xs 2012/06/07 12:56:27 1.180 +++ rxvt-unicode/src/rxvtperl.xs 2012/06/07 17:30:33 1.185 @@ -384,7 +384,7 @@ rxvt_pop_locale (); } - if (perl) + if (perl && !term->perl.self) { // runs outside of perls ENV term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term"); @@ -2034,13 +2034,13 @@ # TODO: ugly void -rxvt_term::get_geometry () +rxvt_term::background_geometry (bool border = false) PPCODE: EXTEND (SP, 4); - PUSHs (sv_2mortal (newSViv (THIS->parent_x))); - PUSHs (sv_2mortal (newSViv (THIS->parent_y))); - PUSHs (sv_2mortal (newSViv (THIS->szHint.width))); - PUSHs (sv_2mortal (newSViv (THIS->szHint.height))); + PUSHs (sv_2mortal (newSViv (THIS->parent_x + (border ? THIS->window_vt_x : 0)))); + PUSHs (sv_2mortal (newSViv (THIS->parent_y + (border ? THIS->window_vt_y : 0)))); + PUSHs (sv_2mortal (newSViv (border ? THIS->vt_width : THIS->szHint.width ))); + PUSHs (sv_2mortal (newSViv (border ? THIS->vt_height : THIS->szHint.height))); #if HAVE_IMG @@ -2098,16 +2098,37 @@ if (img) // TODO: cannot be false { - img = img->reify (); - rxvt_img *img2 = img->convert_to (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]); - delete img; - THIS->bg_pixmap = img2->steal (); + img = img->clone (); // own the img + + { + rxvt_img *img2 = img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]); + delete img; + img = img2; + } + + if (img->repeat != RepeatNormal) // X11 only supports RepeatNormal as bg pixmap + { + rxvt_img *img2 = img->sub_rect (0, 0, + border ? THIS->vt_width : THIS->szHint.width, + border ? THIS->vt_height : THIS->szHint.height); + delete img; + img = img2; + } + + { + // just in case, should usually be a nop + rxvt_img *img2 = img->reify (); + delete img; + img = img2; + } + + THIS->bg_pixmap = img->steal (); THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; if (!border) THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; - THIS->bg_valid_since = ev::now (); // TODO: extra bloat + delete img; } #endif @@ -2191,8 +2212,13 @@ void rxvt_img::unshare () -void -rxvt_img::repeat_mode (render_repeat_mode repeat = RepeatNormal) +int +rxvt_img::repeat_mode (render_repeat_mode repeat = 0) + CODE: + if (items >= 2) + THIS->repeat_mode (repeat); + if (GIMME_V != G_VOID) + XPUSHs (sv_2mortal (newSViv (THIS->repeat))); void rxvt_img::move (int dx, int dy)