--- rxvt-unicode/src/perl/urxvt-popup 2006/01/08 22:58:13 1.12 +++ rxvt-unicode/src/perl/urxvt-popup 2012/06/11 05:03:46 1.17 @@ -1,7 +1,7 @@ #! perl # this extension implements popup-menu functionality for urxvt. it works -# together with the urxvt::popup class. +# together with the urxvt::popup class - "no user serviceable parts inside". sub refresh { my ($self) = @_; @@ -53,11 +53,6 @@ sub on_button_release { my ($self, $event) = @_; - if ($event->{button} == $self->{data}{event}{button}) { - $self->ungrab; - $self->destroy; - } - $self->{press}[$event->{button}] = 0; my ($row, $col) = ($event->{row}, $event->{col}); @@ -69,6 +64,11 @@ $self->refresh; + if ($event->{button} == $self->{data}{event}{button}) { + $self->ungrab; + $self->destroy; + } + 1 } @@ -89,6 +89,9 @@ $_->{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); @@ -105,6 +108,8 @@ $self->resource (geometry => "${width}x${height}$pos"); + $self->{term}{urxvt_popup_init_done} = 1; + () }