diff --git a/tabbedex b/tabbedex index ecbcf1d..542823c 100644 --- a/tabbedex +++ b/tabbedex @@ -891,6 +891,7 @@ sub configure { my ($root) = @_; my $tab = $root->{cur}; + my $padding = 2 * $tab->int_bwidth; # this is an extremely dirty way to force a configurenotify, but who cares $tab->XMoveResizeWindow ( @@ -921,10 +922,26 @@ sub copy_properties { # fix up size hints if ($atom == $wm_normal_hints) { + # typedef struct { + # long flags; /* 0 */ + # int x, y; /* 1, 2 */ /* Obsolete */ + # int width, height; /* 3, 4 */ /* Obsolete */ + # int min_width, min_height; /* 5, 6 */ + # int max_width, max_height; /* 7, 8 */ + # int width_inc, height_inc; /* 9, 10 */ + # struct { + # int x; /* numerator */ + # int y; /* denominator */ + # } min_aspect, max_aspect; /* 11, 12, 13, 14 */ + # int base_width, base_height; /* 15, 16 */ + # int win_gravity; /* 17 */ + # } XSizeHints; + # + # (Don’t ask me how this works with long and int types. Somehow it + # does – mina86). my (@hints) = unpack "l!*", $items; - - $hints[$_] += $root->{tabheight} for (4, 6, 16); - + $hints[$_] += 2 * $tab->int_bwidth for (3, 5, 15); + $hints[$_] += 2 * $tab->int_bwidth + $root->{tabheight} for (4, 6, 16); $items = pack "l!*", @hints; } @@ -1119,6 +1136,7 @@ sub parse_timeouts { sub init { my ($root) = @_; + $root->{padding} = 2 * $root->int_bwidth; $root->{resource} = [map $root->resource ("+$_"), 0 .. urxvt::NUM_RESOURCES - 1]; @@ -1169,6 +1187,13 @@ _on start => sub { $root->int_bwidth + $root->fheight + $root->lineSpace; $root->{tabheight} = $root->{autohide} ? 0 : $root->{maxtabheight}; + my $padding = delete $root->{padding}; + if ($padding || $root->{tabheight}) { + my $w = $root->width + $padding; + my $h = $root->height + $padding + $root->{tabheight}; + $root->XMoveResizeWindow($root->parent, 0, 0, $w, $h); + } + $root->cmd_parse(delete $root->{init_cmd}); my @argv = $root->argv;