repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: c2c59eb9c72087715bcebf1e03c64ac18ee25e95:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit c2c59eb9c72087715bcebf1e03c64ac18ee25e95
Author: Marc Lehmann 
Date:   Sat Mar 4 22:36:50 2006 +0000

    *** empty log message ***

diff --git a/Changes b/Changes
index e466e37275501982c9eac9a9b9068a57dc35b4a0..
index ..1a4a1f1e7b6993e7ea0f7827f99d2d983a642d9c 100644
--- a/Changes
+++ b/Changes
@@ -21,6 +21,8 @@ DUMB: support tex fonts
 	- add FORCE_UNBUFFERED_XFT define to features.h.
 	- moved on_osc_seq to on_osc_seq_perl and added a more
           generic osc_seq.
+        - fix a bug causing double callback invocations when perl hooks
+          were invoked recursively.

 7.7  Tue Feb 21 12:32:49 CET 2006
 	- use double-buffered drawing (xft fonts only). On many driver/hardware
diff --git a/src/perl/automove-background b/src/perl/automove-background
index 7f7bb26ce7a32c0474f851fb55eea3bc61939071..
index ..d6cc6d40c3a37b2b86bb7a6bd9a3151f3e8ca7a2 100644
--- a/src/perl/automove-background
+++ b/src/perl/automove-background
@@ -1,5 +1,25 @@
 #! perl

+sub on_osc_seq {
+   my ($self, $op, $args) = @_;
+
+   if ($op == 20) {
+      my ($pic, $commands) = split(/;/, $args, 2);
+      warn "   pic=$pic commands=$commands";
+      if ($pic !~ /^$/ && $commands !~ /[+\-]/) {
+         my ($x, $y) = $self->XTranslateCoordinates (
+            $self->vt, $self->DefaultRootWindow,
+            0, 0
+         );
+         warn "      $x $y \\033]20;$pic;=+$x+$y\\007";
+         $self->cmd_parse ("\033]20;$pic;=+$x+$y\007");
+         return 1;
+      }
+   }
+
+   ()
+}
+
 sub on_configure_notify {
    my ($self, $event) = @_;

diff --git a/src/urxvt.pm b/src/urxvt.pm
index 4b6ceff26d8f50a0efabea70a132906909aa726a..
index ..00789638e80f5c852e0e09131a05bf77687975b0 100644
--- a/src/urxvt.pm
+++ b/src/urxvt.pm
@@ -909,10 +909,8 @@ sub invoke {
       verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")"
          if $verbosity >= 10;

-      keys %$cb;
-
-      while (my ($pkg, $cb) = each %$cb) {
-         my $retval_ = eval { $cb->($TERM->{_pkg}{$pkg}, @_) };
+      for my $pkg (keys %$cb) {
+         my $retval_ = eval { $cb->{$pkg}->($TERM->{_pkg}{$pkg}, @_) };
          $retval ||= $retval_;

          if ($@) {

-----END OF PAGE-----