i3-save-tree: retain “rect” for floating_cons

This commit is contained in:
Michael Stapelberg 2015-08-05 22:43:18 +02:00
parent 57438d270d
commit 6d022e6dc9

View File

@ -99,6 +99,7 @@ my %allowed_keys = map { ($_, 1) } qw(
geometry geometry
window_properties window_properties
mark mark
rect
); );
sub strip_containers { sub strip_containers {
@ -116,6 +117,9 @@ sub strip_containers {
delete $tree->{geometry} if zero_rect($tree->{geometry}); delete $tree->{geometry} if zero_rect($tree->{geometry});
# Retain the rect for floating containers to keep their positions.
delete $tree->{rect} unless $tree->{type} eq 'floating_con';
delete $tree->{current_border_width} if $tree->{current_border_width} == -1; delete $tree->{current_border_width} if $tree->{current_border_width} == -1;
for my $key (keys %$tree) { for my $key (keys %$tree) {