--- rxvt-unicode/src/perl/tabbed 2006/01/20 16:18:07 1.10 +++ rxvt-unicode/src/perl/tabbed 2006/02/03 05:49:42 1.14 @@ -73,16 +73,31 @@ my $tab = $self->{cur}; + # this is an extremely dirty way to force a configurenotify, but who cares + $tab->XMoveResizeWindow ( + $tab->parent, + 0, $self->{tabheight} + 1, + $self->width, $self->height - $self->{tabheight} + ); $tab->XMoveResizeWindow ( $tab->parent, 0, $self->{tabheight}, $self->width, $self->height - $self->{tabheight} ); +} + +sub copy_properties { + my ($self) = @_; + my $tab = $self->{cur}; my $wm_normal_hints = $self->XInternAtom ("WM_NORMAL_HINTS"); + my %our_props = map +($_ => undef), $self->XListProperties ($self->parent); + for my $atom ($tab->XListProperties ($tab->parent)) { my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom); + + delete $our_props{$atom}; if ($atom == $wm_normal_hints) { my (@hints) = unpack "l!*", $items; @@ -94,7 +109,7 @@ $self->XChangeWindowProperty ($self->parent, $atom, $type, $format, $items); } - $self->refresh; + $self->XDeleteProperty ($self->parent, $_) for keys %our_props; } sub make_current { @@ -109,6 +124,7 @@ $self->{cur} = $tab; $self->configure; + $self->copy_properties; $tab->focus_in; $tab->XMapWindow ($tab->parent); delete $tab->{activity}; @@ -172,6 +188,7 @@ my ($self, $event) = @_; $self->configure; + $self->refresh; () } @@ -187,6 +204,8 @@ sub tab_start { my ($self, $tab) = @_; + $tab->XChangeInput ($tab->parent, urxvt::PropertyChangeMask); + push @{ $self->{tabs} }, $tab; # $tab->{name} ||= scalar @{ $self->{tabs} }; @@ -238,6 +257,15 @@ () } +sub tab_property_notify { + my ($self, $tab, $event) = @_; + + $self->copy_properties + if $event->{window} == $tab->parent; + + () +} + sub tab_activity { my ($self, $tab) = @_; @@ -250,7 +278,7 @@ # simply proxies all interesting calls back to the tabbed class. { - for my $hook qw(start destroy key_press) { + for my $hook qw(start destroy key_press property_notify) { eval qq{ sub on_$hook { my \$parent = \$_[0]{term}{parent}