… | |
… | |
43 | $self->want_refresh; |
43 | $self->want_refresh; |
44 | } |
44 | } |
45 | |
45 | |
46 | sub new_tab { |
46 | sub 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 | |
93 | sub on_resize_all_windows { |
93 | sub 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 | () |
… | |
… | |
320 | |
320 | |
321 | --$idx if $keysym == 0xff51; |
321 | --$idx if $keysym == 0xff51; |
322 | ++$idx if $keysym == 0xff53; |
322 | ++$idx if $keysym == 0xff53; |
323 | |
323 | |
324 | $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]); |
324 | $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]); |
325 | |
325 | |
326 | return 1; |
326 | return 1; |
327 | } elsif ($keysym == 0xff54) { |
327 | } elsif ($keysym == 0xff54) { |
328 | $self->new_tab; |
328 | $self->new_tab; |
329 | |
329 | |
330 | return 1; |
330 | return 1; |