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.25 by root, Sun Jun 15 14:54:44 2008 UTC vs.
Revision 1.29 by mikachu, Mon Jan 9 17:49:00 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;
79 77
80 # this is an extremely dirty way to force a configurenotify, but who cares 78 # this is an extremely dirty way to force a configurenotify, but who cares
81 $tab->XMoveResizeWindow ( 79 $tab->XMoveResizeWindow (
82 $tab->parent, 80 $tab->parent,
83 0, $self->{tabheight} + 1, 81 0, $self->{tabheight} + 1,
84 $self->width, $self->height - $self->{tabheight} 82 $self->width,
83 $self->height - $self->{tabheight} + 2 * $tab->int_bwidth
85 ); 84 );
86 $tab->XMoveResizeWindow ( 85 $tab->XMoveResizeWindow (
87 $tab->parent, 86 $tab->parent,
88 0, $self->{tabheight}, 87 0, $self->{tabheight},
89 $self->width, $self->height - $self->{tabheight} 88 $self->width,
89 $self->height - $self->{tabheight} + 2 * $tab->int_bwidth
90 ); 90 );
91} 91}
92 92
93sub on_resize_all_windows { 93sub on_resize_all_windows {
94 my ($self, $width, $height) = @_; 94 my ($self, $width, $height) = @_;
105 my $current = delete $self->{current_properties}; 105 my $current = delete $self->{current_properties};
106 106
107 # pass 1: copy over properties different or nonexisting 107 # pass 1: copy over properties different or nonexisting
108 for my $atom ($tab->XListProperties ($tab->parent)) { 108 for my $atom ($tab->XListProperties ($tab->parent)) {
109 my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom); 109 my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom);
110 110
111 # fix up size hints 111 # fix up size hints
112 if ($atom == $wm_normal_hints) { 112 if ($atom == $wm_normal_hints) {
113 my (@hints) = unpack "l!*", $items; 113 my (@hints) = unpack "l!*", $items;
114 114
115 $hints[$_] += $self->{tabheight} for (4, 6, 16); 115 $hints[$_] += $self->{tabheight} for (4, 6, 16);
116 116
117 $items = pack "l!*", @hints; 117 $items = pack "l!*", @hints;
118 } 118 }
119 119
120 my $cur = delete $current->{$atom}; 120 my $cur = delete $current->{$atom};
121 121
136 if (my $cur = $self->{cur}) { 136 if (my $cur = $self->{cur}) {
137 delete $cur->{activity}; 137 delete $cur->{activity};
138 $cur->XUnmapWindow ($cur->parent) if $cur->mapped; 138 $cur->XUnmapWindow ($cur->parent) if $cur->mapped;
139 $cur->focus_out; 139 $cur->focus_out;
140 } 140 }
141 141
142 $self->{cur} = $tab; 142 $self->{cur} = $tab;
143 143
144 $self->configure; 144 $self->configure;
145 $self->copy_properties; 145 $self->copy_properties;
146 146
147 $tab->focus_out; # just in case, should be a nop 147 $tab->focus_out; # just in case, should be a nop
148 $tab->focus_in if $self->focus; 148 $tab->focus_in if $self->focus;
149 149
150 $tab->XMapWindow ($tab->parent); 150 $tab->XMapWindow ($tab->parent);
151 delete $tab->{activity}; 151 delete $tab->{activity};
152 $self->refresh; 152 $self->refresh;
153 153
154 () 154 ()
166 my ($self, $event) = @_; 166 my ($self, $event) = @_;
167 167
168 $self->{cur}->focus_out; 168 $self->{cur}->focus_out;
169 169
170 () 170 ()
171}
172
173sub on_tt_write {
174 my ($self, $octets) = @_;
175
176 $self->{cur}->tt_write ($octets);
177
178 1
171} 179}
172 180
173sub on_key_press { 181sub on_key_press {
174 my ($self, $event) = @_; 182 my ($self, $event) = @_;
175 183
312 320
313 --$idx if $keysym == 0xff51; 321 --$idx if $keysym == 0xff51;
314 ++$idx if $keysym == 0xff53; 322 ++$idx if $keysym == 0xff53;
315 323
316 $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]); 324 $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]);
317 325
318 return 1; 326 return 1;
319 } elsif ($keysym == 0xff54) { 327 } elsif ($keysym == 0xff54) {
320 $self->new_tab; 328 $self->new_tab;
321 329
322 return 1; 330 return 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines