--- rxvt-unicode/src/rxvtperl.xs 2017/07/15 08:16:31 1.242 +++ rxvt-unicode/src/rxvtperl.xs 2021/07/14 12:39:57 1.251 @@ -84,15 +84,15 @@ c.a = rgba::MAX_CC; - c.r = c.g = c.b = float_to_component (SvIV (*av_fetch (av, 0, 0))); + c.r = c.g = c.b = float_to_component (SvNV (*av_fetch (av, 0, 0))); if (len >= 3) { - c.g = float_to_component (SvIV (*av_fetch (av, 1, 0))); - c.b = float_to_component (SvIV (*av_fetch (av, 2, 0))); + c.g = float_to_component (SvNV (*av_fetch (av, 1, 0))); + c.b = float_to_component (SvNV (*av_fetch (av, 2, 0))); if (len >= 4) - c.a = float_to_component (SvIV (*av_fetch (av, 3, 0))); + c.a = float_to_component (SvNV (*av_fetch (av, 3, 0))); } } else if (s) @@ -372,15 +372,20 @@ static PerlInterpreter *perl; +#if 0 /* we are not a library anymore, so doing this is just not worth it */ +/*THINK/TODO: this has the side effect of, of course, not calling destructors. */ +/* but therse are not guaranteed anyway... */ rxvt_perl_interp::~rxvt_perl_interp () { if (perl) { + localise_env set_environ (perl_environ); perl_destruct (perl); perl_free (perl); PERL_SYS_TERM (); } } +#endif void rxvt_perl_interp::init () @@ -393,7 +398,7 @@ perl_environ = rxvt_environ; localise_env set_environ (perl_environ); - char *args[] = { + const char *args[] = { "", "-e" "BEGIN {" @@ -401,10 +406,11 @@ " unshift @INC, '" LIBDIR "';" "}" "" - "use urxvt;" + "use urxvt;", + 0 }; - int argc = ecb_array_length (args); - char **argv = args; + int argc = ecb_array_length (args) - 1; + char **argv = (char **)args; PERL_SYS_INIT3 (&argc, &argv, &environ); perl = perl_alloc (); @@ -1047,8 +1053,8 @@ const_iv (PrivMode_MouseBtnEvent), const_iv (PrivMode_MouseAnyEvent), const_iv (PrivMode_BracketPaste), - const_iv (PrivMode_ExtModeMouse), - const_iv (PrivMode_ExtMouseRight), + const_iv (PrivMode_ExtMouseUTF8), + const_iv (PrivMode_ExtMouseUrxvt), const_iv (PrivMode_BlinkingCursor), const_iv (PrivMode_mouse_report), const_iv (PrivMode_Default), @@ -1563,9 +1569,8 @@ CODE: { RETVAL = THIS->view_start; - - if (newval <= 0) - THIS->scr_changeview (max (newval, THIS->top_row)); + if (items > 1) + THIS->scr_changeview (newval); } OUTPUT: RETVAL @@ -1785,7 +1790,7 @@ if (*s == NOCHAR) ; else if (IS_COMPOSE (*s)) - dlen += rxvt_composite.expand (*s, 0); + dlen += rxvt_composite.expand (*s); else dlen++; @@ -1833,7 +1838,7 @@ else { --rs; - name = ""; + name = (octet_string)""; } if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) @@ -2313,13 +2318,20 @@ #endif void +rxvt_term::clr_background () + CODE: + delete THIS->bg_img; + THIS->bg_img = 0; + THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH; + +void rxvt_term::set_background (rxvt_img *img, bool border = false) CODE: delete THIS->bg_img; THIS->bg_img = 0; - THIS->bg_flags = 0; + THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH; - if (img) // TODO: cannot be false + //if (img) // TODO: cannot be false, maybe allow and get rid of clr_background? { img = img->clone (); // own the img @@ -2337,7 +2349,6 @@ ->replace (img); THIS->bg_img = img; - THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH; if (!border) THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT;