Automatic window rebalancing thanks to @kroogs