From 07f3dc7ed02e540cc978f8b347312d8621d9760d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 Jan 2006 11:05:09 +0000 Subject: [PATCH] *** empty log message *** --- src/perl/digital-clock | 2 +- src/perl/example-refresh-hooks | 8 +++----- src/perl/selection-autotransform | 2 +- src/perl/selection-pastebin | 2 +- src/perl/selection-popup | 2 +- src/perl/urxvt-popup | 3 +++ src/rxvtperl.xs | 7 +++++++ src/screen.C | 2 +- src/urxvt.pm | 6 +++++- 9 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/perl/digital-clock b/src/perl/digital-clock index 29a6c767..ca02d8e5 100644 --- a/src/perl/digital-clock +++ b/src/perl/digital-clock @@ -8,7 +8,7 @@ sub on_init { $self->{overlay} = $self->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); $self->{timer} = urxvt::timer ->new - ->start (int urxvt::NOW) # make sure we update "on" the second + ->start (1 + int urxvt::NOW) # make sure we update "on" the second ->interval (1) ->cb (sub { $self->{overlay}->set (0, 0, diff --git a/src/perl/example-refresh-hooks b/src/perl/example-refresh-hooks index 413951ee..f3a118f3 100644 --- a/src/perl/example-refresh-hooks +++ b/src/perl/example-refresh-hooks @@ -8,11 +8,9 @@ sub on_init { # force a refresh every second $self->{digital_clock_refresh} = urxvt::timer ->new - ->start (urxvt::NOW) - ->cb (sub { - $self->{digital_clock_refresh}->start ($self->{digital_clock_refresh}->at + 1); - $self->want_refresh; - }); + ->start (1 + int urxvt::NOW) + ->interval (1) + ->cb (sub { $self->want_refresh }); () } diff --git a/src/perl/selection-autotransform b/src/perl/selection-autotransform index 6bc3a3f5..699ce9a4 100644 --- a/src/perl/selection-autotransform +++ b/src/perl/selection-autotransform @@ -5,7 +5,7 @@ sub msg { my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1); $overlay->set (0, 0, $msg); - my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 2)->cb (sub { + my $iow; $iow = urxvt::timer->new->after (2)->cb (sub { undef $overlay; undef $iow; }); diff --git a/src/perl/selection-pastebin b/src/perl/selection-pastebin index fb1389ac..637328a5 100644 --- a/src/perl/selection-pastebin +++ b/src/perl/selection-pastebin @@ -43,7 +43,7 @@ sub upload_paste { my $timer; $timer = urxvt::timer ->new - ->start (urxvt::NOW + 5) + ->after (5) ->cb (sub {undef $timer; undef $ov; }); } diff --git a/src/perl/selection-popup b/src/perl/selection-popup index 24c08eff..bcb0b4e7 100644 --- a/src/perl/selection-popup +++ b/src/perl/selection-popup @@ -5,7 +5,7 @@ sub msg { my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1); $overlay->set (0, 0, $msg); - my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 1)->cb (sub { + my $iow; $iow = urxvt::timer->new->after (1)->cb (sub { undef $overlay; undef $iow; }); diff --git a/src/perl/urxvt-popup b/src/perl/urxvt-popup index ca2d0f8e..8fd3bffb 100644 --- a/src/perl/urxvt-popup +++ b/src/perl/urxvt-popup @@ -89,6 +89,9 @@ sub on_init { $_->{width} = $self->strwidth ($_->{text}) for @{ $data->{item} }; + $self->resource (title => "URxvt Popup Menu"); + $self->resource (name => "URxvt.popup"); + $self->resource ($_ => $data->{term}->resource ($_)) for qw(font boldFont italicFont boldItalicFont color+0 color+1); diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 60fcd562..9266a9d3 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1716,6 +1716,13 @@ timer::start (NV tstamp = THIS->at) OUTPUT: RETVAL +timer * +timer::after (NV delay) + CODE: + THIS->start (NOW + delay); + OUTPUT: + RETVAL + timer * timer::stop () CODE: diff --git a/src/screen.C b/src/screen.C index 1b626c41..2b107068 100644 --- a/src/screen.C +++ b/src/screen.C @@ -634,7 +634,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) { // basically this is a slightly optimized scr_blank_screen_mem // it is worth the effort on slower machines - line_t &l = ROW(row2 - i); + line_t &l = ROW(nrow - 1 - i); scr_blank_line (l, 0, l.l, rstyle); diff --git a/src/urxvt.pm b/src/urxvt.pm index 2b984c6e..a88ce404 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -1592,7 +1592,7 @@ sub show { delete $env->{LC_ALL}; $env->{LC_CTYPE} = $self->{term}->locale; - urxvt::term->new ($env, $self->{term}->resource ("name"), + urxvt::term->new ($env, "popup", "--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0, "--transient-for" => $self->{term}->parent, "-display" => $self->{term}->display_id, @@ -1656,6 +1656,10 @@ Start the timer. Set the event trigger time to C<$tstamp> and start the timer. +=item $timer = $timer->after ($delay) + +Like C, but sets the expiry timer to c. + =item $timer = $timer->stop Stop the timer. -- 2.34.1