-- 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: 701dc4e57904181590b656adc006e899dc3d552e:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 701dc4e57904181590b656adc006e899dc3d552e
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Thu Jun 14 16:22:20 2012 +0000

    *** empty log message ***

diff --git a/src/perl/background b/src/perl/background

index 6754c30431b363050e690834e4cbe81a86017f1d..

index ..44d91df2be8dca4e71e357cfe5a8c9d21c1af87c 100644

--- a/src/perl/background
+++ b/src/perl/background
@@ -73,7 +73,7 @@ which means you could use multiple lines and statements:
       return scale load "$HOME/sunday.png";
    }

-This expression gets evaluated once per hour. It will set F<sunday.png> as
+This expression is evaluated once per hour. It will set F<sunday.png> as
 background on Sundays, and F<weekday.png> on all other days.

 Fortunately, we expect that most expressions will be much simpler, with
@@ -231,14 +231,31 @@ points to get an image you can play with.
 Loads the image at the given C<$path>. The image is set to plane tiling
 mode.

-Loaded images will be cached for one cycle.
+Loaded images will be cached for one cycle, and shared between temrinals
+running in the same process (e.g. in C<urxvtd>).
+
+=item load_uc $path
+
+Load uncached - same as load, but does not cache the image. This function
+is most useufl if you want to optimise a background expression in some
+way.

 =cut

+   sub load_uc($) {
+      my ($path) = @_;
+
+      $_IMG_CACHE{$path} || do {
+         my $img = $self->new_img_from_file ($path);
+         Scalar::Util::weaken ($_IMG_CACHE{$path} = $img);
+         $img
+      }
+   }
+
    sub load($) {
       my ($path) = @_;

-      $new->{load}{$path} = $old->{load}{$path} || $self->new_img_from_file ($path);
+      $new->{load}{$path} = $old->{load}{$path} || load_uc $path;
    }

 =item root

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

-- Response ended

-- Page fetched on Sun Jun 2 12:35:03 2024