ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/tabbed
(Generate patch)

Comparing rxvt-unicode/src/perl/tabbed (file contents):
Revision 1.26 by sf-exg, Mon Sep 26 10:12:30 2011 UTC vs.
Revision 1.30 by mikachu, Mon Jan 9 17:57:04 2012 UTC

43 $self->want_refresh; 43 $self->want_refresh;
44} 44}
45 45
46sub new_tab { 46sub new_tab {
47 my ($self, @argv) = @_; 47 my ($self, @argv) = @_;
48
49 my $offset = $self->fheight;
50 48
51 # save a backlink to us, make sure tabbed is inactive 49 # save a backlink to us, make sure tabbed is inactive
52 push @urxvt::TERM_INIT, sub { 50 push @urxvt::TERM_INIT, sub {
53 my ($term) = @_; 51 my ($term) = @_;
54 $term->{parent} = $self; 52 $term->{parent} = $self;
105 my $current = delete $self->{current_properties}; 103 my $current = delete $self->{current_properties};
106 104
107 # pass 1: copy over properties different or nonexisting 105 # pass 1: copy over properties different or nonexisting
108 for my $atom ($tab->XListProperties ($tab->parent)) { 106 for my $atom ($tab->XListProperties ($tab->parent)) {
109 my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom); 107 my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom);
110 108
111 # fix up size hints 109 # fix up size hints
112 if ($atom == $wm_normal_hints) { 110 if ($atom == $wm_normal_hints) {
113 my (@hints) = unpack "l!*", $items; 111 my (@hints) = unpack "l!*", $items;
114 112
115 $hints[$_] += $self->{tabheight} for (4, 6, 16); 113 $hints[$_] += $self->{tabheight} for (4, 6, 16);
116 114
117 $items = pack "l!*", @hints; 115 $items = pack "l!*", @hints;
118 } 116 }
119 117
120 my $cur = delete $current->{$atom}; 118 my $cur = delete $current->{$atom};
121 119
136 if (my $cur = $self->{cur}) { 134 if (my $cur = $self->{cur}) {
137 delete $cur->{activity}; 135 delete $cur->{activity};
138 $cur->XUnmapWindow ($cur->parent) if $cur->mapped; 136 $cur->XUnmapWindow ($cur->parent) if $cur->mapped;
139 $cur->focus_out; 137 $cur->focus_out;
140 } 138 }
141 139
142 $self->{cur} = $tab; 140 $self->{cur} = $tab;
143 141
144 $self->configure; 142 $self->configure;
145 $self->copy_properties; 143 $self->copy_properties;
146 144
147 $tab->focus_out; # just in case, should be a nop 145 $tab->focus_out; # just in case, should be a nop
148 $tab->focus_in if $self->focus; 146 $tab->focus_in if $self->focus;
149 147
150 $tab->XMapWindow ($tab->parent); 148 $tab->XMapWindow ($tab->parent);
151 delete $tab->{activity}; 149 delete $tab->{activity};
152 $self->refresh; 150 $self->refresh;
153 151
154 () 152 ()
320 318
321 --$idx if $keysym == 0xff51; 319 --$idx if $keysym == 0xff51;
322 ++$idx if $keysym == 0xff53; 320 ++$idx if $keysym == 0xff53;
323 321
324 $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]); 322 $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]);
325 323
326 return 1; 324 return 1;
327 } elsif ($keysym == 0xff54) { 325 } elsif ($keysym == 0xff54) {
328 $self->new_tab; 326 $self->new_tab;
329 327
330 return 1; 328 return 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines