*** empty log message ***
authorroot <root>
Sun, 15 Jun 2008 14:54:44 +0000 (14:54 +0000)
committerroot <root>
Sun, 15 Jun 2008 14:54:44 +0000 (14:54 +0000)
Changes
src/perl/tabbed
src/rxvtperl.xs
src/urxvt.pm

diff --git a/Changes b/Changes
index 5ad9c2ab03709efcdb43cf5241245b23507afbf0..8ff04bfd8d19419da4551a6bf7641478531c3860 100644 (file)
--- a/Changes
+++ b/Changes
@@ -8,7 +8,8 @@ TODO: overlays collide with the way the out-of-focus cursor is being drawn
 TODO: "slow" rendering mode for bidi and scripts, pango!
 TODO: read property sequence is broken with respect to utf-8 etc.
 TODO: slow drag selection on remote display - other things seem fast (rxvt illness, motion hints?)
-TODO: investigate -pe tabbed -g 80x25 being 23 not 24 or 25 lines
+TODO: better resource handling for tabbar in -pe tabbed.
+WISH: investigate -pe tabbed -g 80x25 being 23 not 24 or 25 lines
       => when setting the constraints, the wm might (correctly)
          resize the outer window, which might result in a smaller window overall.
          or something like that. guys, send me a patch.
@@ -18,9 +19,6 @@ WISH: load system-wide config file even if we don't have one
 WISH: look into XAddConnectionWatch, does anybody need that?
 DUMB: support tex fonts
 
-TODO: rxvt -font 10x20 -xrm "*.tabbed.font: 10x20" -pe tabbed
-      how does one affect the tab windows themselves? seems not to work anymore.
-
        - new option --cd/chdir to set the starting working directory.
         - tabbed extension now starts in the "correct" working directory.
        - work around fedora 9 providing isastream but not the relevant
@@ -37,6 +35,8 @@ TODO: rxvt -font 10x20 -xrm "*.tabbed.font: 10x20" -pe tabbed
        - made tabs moveable (based on a patch by Petr Machata).
         - implement ESC [ 3 K as a more rational alternative to ESC [ 0 K.
         - support relative paths for RXVT_SOCKET in urxvtd.
+        - the tabbed extension now blindly copies over all (rxvt-) resources
+          from the toplevel window to the children.
         - better diagnostic on 0x0 window geometries.
         - update AnyEvent API to version 3.4 and above.
         - document the default value of :0 for DISPLAY.
index 89ec0a9680ad0c897b134554bf80cedaf1c661d5..fc08a78b656a8c3ae00abad742397d98d650bcda 100644 (file)
@@ -53,8 +53,12 @@ sub new_tab {
       my ($term) = @_;
       $term->{parent} = $self;
 
-      $term->resource ($_->[0] => $_->[1])
-         for @{ $self->{resource} || [] };
+      for (0 .. urxvt::NUM_RESOURCES - 1) {
+         my $value = $self->{resource}[$_];
+
+         $term->resource ("+$_" => $value)
+            if defined $value;
+      }
 
       $term->resource (perl_ext_2 => $term->resource ("perl_ext_2") . ",-tabbed");
    };
@@ -207,12 +211,7 @@ sub on_motion_notify {
 sub on_init {
    my ($self) = @_;
 
-   for (qw(name chdir perl_ext_1 perl_ext_2)) {
-      my $val = $self->resource ($_);
-
-      push @{ $self->{resource} }, [$_ => $val]
-        if defined $val;
-   }
+   $self->{resource} = [map $self->resource ("+$_"), 0 .. urxvt::NUM_RESOURCES - 1];
 
    $self->resource (int_bwidth => 0);
    $self->resource (name => "URxvt.tabbed");
index dfbcdb78eb91da8ff56e7f9a5618e11fe0bd5652..7706441dd28e7045793db43a6615dfcad7f0412d 100644 (file)
@@ -641,6 +641,7 @@ BOOT:
     IV iv;
   } *civ, const_iv[] = {
 #   define const_iv(name) { # name, (IV)name }
+    const_iv (NUM_RESOURCES),
     const_iv (DEFAULT_RSTYLE),
     const_iv (OVERLAY_RSTYLE),
     const_iv (RS_Bold),
@@ -1432,12 +1433,20 @@ rxvt_term::_resource (char *name, int index, SV *newval = 0)
 
         rs = rslist + sizeof (rslist) / sizeof (rslist [0]);
 
-        do {
-          if (rs-- == rslist)
-            croak ("no such resource '%s', requested", name);
-        } while (strcmp (name, rs->name));
+        if (*name)
+          {
+            do {
+              if (rs-- == rslist)
+                croak ("no such resource '%s', requested", name);
+            } while (strcmp (name, rs->name));
 
-        index += rs->value;
+            index += rs->value;
+          }
+        else
+          {
+            --rs;
+            name = "";
+          }
 
         if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES))
           croak ("requested out-of-bound resource %s+%d,", name, index - rs->value);
index 523573c12bc4001022fe52545c39f624b5df7ec5..ab9f0b80a3c9a8bca9ce61f0b6d8d3da8ce66312 100644 (file)
@@ -1282,7 +1282,7 @@ to see the actual list:
 sub resource($$;$) {
    my ($self, $name) = (shift, shift);
    unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0);
-   &urxvt::term::_resource
+   goto &urxvt::term::_resource
 }
 
 =item $value = $term->x_resource ($pattern)