… | |
… | |
1091 | is that you cannot use blocking APIs, but the non-blocking variant should |
1091 | is that you cannot use blocking APIs, but the non-blocking variant should |
1092 | work. |
1092 | work. |
1093 | |
1093 | |
1094 | =cut |
1094 | =cut |
1095 | |
1095 | |
1096 | our $VERSION = 1; |
1096 | our $VERSION = '3.4'; |
1097 | |
1097 | |
1098 | $INC{"urxvt/anyevent.pm"} = 1; # mark us as there |
1098 | $INC{"urxvt/anyevent.pm"} = 1; # mark us as there |
1099 | push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; |
1099 | push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; |
1100 | |
1100 | |
1101 | sub timer { |
1101 | sub timer { |
… | |
… | |
1132 | |
1132 | |
1133 | sub DESTROY { |
1133 | sub DESTROY { |
1134 | $_[0][1]->stop; |
1134 | $_[0][1]->stop; |
1135 | } |
1135 | } |
1136 | |
1136 | |
1137 | sub condvar { |
|
|
1138 | bless \my $flag, urxvt::anyevent:: |
|
|
1139 | } |
|
|
1140 | |
|
|
1141 | sub broadcast { |
|
|
1142 | ${$_[0]}++; |
|
|
1143 | } |
|
|
1144 | |
|
|
1145 | sub wait { |
|
|
1146 | unless (${$_[0]}) { |
|
|
1147 | Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; |
|
|
1148 | } |
|
|
1149 | } |
|
|
1150 | |
|
|
1151 | sub one_event { |
1137 | sub one_event { |
1152 | Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; |
1138 | Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; |
1153 | } |
1139 | } |
1154 | |
1140 | |
1155 | package urxvt::term; |
1141 | package urxvt::term; |
… | |
… | |
1285 | mouseWheelScrollPage name override_redirect pastableTabs path perl_eval |
1271 | mouseWheelScrollPage name override_redirect pastableTabs path perl_eval |
1286 | perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay |
1272 | perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay |
1287 | preeditType print_pipe pty_fd reverseVideo saveLines scrollBar |
1273 | preeditType print_pipe pty_fd reverseVideo saveLines scrollBar |
1288 | scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness |
1274 | scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness |
1289 | scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle |
1275 | scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle |
1290 | secondaryScreen secondaryScroll selectstyle shade term_name title |
1276 | secondaryScreen secondaryScroll shade term_name title |
1291 | transient_for transparent transparent_all tripleclickwords utmpInhibit |
1277 | transient_for transparent transparent_all tripleclickwords utmpInhibit |
1292 | visualBell |
1278 | visualBell |
1293 | |
1279 | |
1294 | =cut |
1280 | =cut |
1295 | |
1281 | |
… | |
… | |
1954 | my $env = $self->{term}->env; |
1940 | my $env = $self->{term}->env; |
1955 | # we can't hope to reproduce the locale algorithm, so nuke LC_ALL and set LC_CTYPE. |
1941 | # we can't hope to reproduce the locale algorithm, so nuke LC_ALL and set LC_CTYPE. |
1956 | delete $env->{LC_ALL}; |
1942 | delete $env->{LC_ALL}; |
1957 | $env->{LC_CTYPE} = $self->{term}->locale; |
1943 | $env->{LC_CTYPE} = $self->{term}->locale; |
1958 | |
1944 | |
1959 | urxvt::term->new ($env, "popup", |
1945 | my $term = urxvt::term->new ( |
|
|
1946 | $env, "popup", |
1960 | "--perl-lib" => "", "--perl-ext-common" => "", |
1947 | "--perl-lib" => "", "--perl-ext-common" => "", |
1961 | "-pty-fd" => -1, "-sl" => 0, |
1948 | "-pty-fd" => -1, "-sl" => 0, |
1962 | "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect", |
1949 | "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect", |
1963 | "--transient-for" => $self->{term}->parent, |
1950 | "--transient-for" => $self->{term}->parent, |
1964 | "-display" => $self->{term}->display_id, |
1951 | "-display" => $self->{term}->display_id, |
1965 | "-pe" => "urxvt-popup") |
1952 | "-pe" => "urxvt-popup", |
1966 | or die "unable to create popup window\n"; |
1953 | ) or die "unable to create popup window\n"; |
|
|
1954 | |
|
|
1955 | unless (delete $term->{urxvt_popup_init_done}) { |
|
|
1956 | $term->ungrab; |
|
|
1957 | $term->destroy; |
|
|
1958 | die "unable to initialise popup window\n"; |
|
|
1959 | } |
1967 | } |
1960 | } |
1968 | |
1961 | |
1969 | sub DESTROY { |
1962 | sub DESTROY { |
1970 | my ($self) = @_; |
1963 | my ($self) = @_; |
1971 | |
1964 | |