--- rxvt-unicode/src/perl/tabbed 2006/02/11 01:58:28 1.16 +++ rxvt-unicode/src/perl/tabbed 2006/02/20 20:44:22 1.21 @@ -44,7 +44,7 @@ } sub new_tab { - my ($self) = @_; + my ($self, @argv) = @_; my $offset = $self->fheight; @@ -65,6 +65,7 @@ my $term = new urxvt::term $self->env, $urxvt::RXVTNAME, -embed => $self->parent, + @argv, ; } @@ -86,16 +87,23 @@ ); } +sub on_resize_all_windows { + my ($self, $width, $height) = @_; + + 1 +} + sub copy_properties { my ($self) = @_; my $tab = $self->{cur}; my $wm_normal_hints = $self->XInternAtom ("WM_NORMAL_HINTS"); - my $wm_state = $self->XInternAtom ("WM_STATE"); my %our_props = map +($_ => undef), $self->XListProperties ($self->parent); - delete $our_props{$wm_state}; + delete $our_props{$self->XInternAtom ($_)} + for qw(WM_STATE WM_ICON_SIZE + _NET_WM_VISIBLE_NAME _NET_WM_VISIBLE_ICON_NAME _NET_WM_ICON_GEOMETRY _NET_FRAME_EXTENTS); for my $atom ($tab->XListProperties ($tab->parent)) { my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom); @@ -104,12 +112,17 @@ if ($atom == $wm_normal_hints) { my (@hints) = unpack "l!*", $items; - + $hints[$_] += $self->{tabheight} for (4, 6, 16); - + $items = pack "l!*", @hints; } - $self->XChangeWindowProperty ($self->parent, $atom, $type, $format, $items); + + my ($dtype, $dformat, $ditems) = $self->XGetWindowProperty ($self->parent, $atom); + + if ($dtype != $type or $dformat != $format or $ditems ne $items) { + $self->XChangeWindowProperty ($self->parent, $atom, $type, $format, $items); + } } $self->XDeleteProperty ($self->parent, $_) for keys %our_props; @@ -128,7 +141,10 @@ $self->configure; $self->copy_properties; - $tab->focus_in; + + $tab->focus_out; # just in case, should be a nop + $tab->focus_in if $self->focus; + $tab->XMapWindow ($tab->parent); delete $tab->{activity}; $self->refresh; @@ -229,7 +245,13 @@ $self->cmd_parse ("\033[?25l"); - $self->new_tab; + my @argv = $self->argv; + + do { + shift @argv; + } while @argv && $argv[0] ne "-e"; + + $self->new_tab (@argv); () }