Merge "Move all the window layout logic to WindowLayout"