From 41f3dfe8c4b2566d6866d5850f2e53787b486bcc Mon Sep 17 00:00:00 2001 From: root Date: Sun, 15 Jun 2008 14:54:44 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 8 ++++---- src/perl/tabbed | 15 +++++++-------- src/rxvtperl.xs | 19 ++++++++++++++----- src/urxvt.pm | 2 +- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Changes b/Changes index 5ad9c2ab..8ff04bfd 100644 --- 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. diff --git a/src/perl/tabbed b/src/perl/tabbed index 89ec0a96..fc08a78b 100644 --- a/src/perl/tabbed +++ b/src/perl/tabbed @@ -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"); diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index dfbcdb78..7706441d 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -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); diff --git a/src/urxvt.pm b/src/urxvt.pm index 523573c1..ab9f0b80 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -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) -- 2.34.1