-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 238b3dfedf3d1bece76170c9cb538f1bfc36f3f6: path_to: revision_to:
commit 238b3dfedf3d1bece76170c9cb538f1bfc36f3f6 Author: Tim Pope <code@tpope.net> Date: Fri Aug 19 23:02:46 2011 +0000 Consume button release events in matcher diff --git a/Changes b/Changes
--- a/Changes +++ b/Changes @@ -39,6 +39,7 @@ TODO: split ROW into a ROW_fast (0..total*2-1) and ROW macros? - correctly split long lines when scrolling. - Fix compilation on systems with bsd style utmp and no utmpx, such as openbsd. + - consume button release event in matcher (exg). 9.12 Wed Jun 29 14:34:28 CEST 2011 - fix regression in processing of SelectionNotify events. diff --git a/src/perl/matcher b/src/perl/matcher
--- a/src/perl/matcher +++ b/src/perl/matcher @@ -164,12 +164,16 @@ sub command_for { sub on_button_press { my ($self, $event) = @_; - if($self->valid_button($event)) { + if($self->valid_button($event) + && (my @exec = $self->command_for($event->{row},$event->{col}))) { $self->{row} = $event->{row}; $self->{col} = $event->{col}; + $self->{cmd} = \@exec; + return 1; } else { delete $self->{row}; delete $self->{col}; + delete $self->{cmd}; } () @@ -180,19 +184,20 @@ sub on_button_release { my $row = delete $self->{row}; my $col = delete $self->{col}; + my $cmd = delete $self->{cmd}; - if(defined($row) && $row == $event->{row} && abs($col-$event->{col}) < 2) { + return if !defined $row; + + if($row == $event->{row} && abs($col-$event->{col}) < 2 + && join("\x00", @$cmd) eq join("\x00", $self->command_for($row,$col))) { if($self->valid_button($event)) { - my @exec = $self->command_for($row,$col); - if(@exec) { - return $self->exec_async (@exec); - } + $self->exec_async (@$cmd); } } - () + 1; } # vim:set sw=3 sts=3 et:
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 11:35:55 2024