tiles: fix incorrect split of single tile

The bug could be reproduced like this:

  • Load the 3 column custom tiling layout.
  • Delete 2 of the columns.
  • Split the remaining column into top/bottom.
  • Reload kwin.
  • There is only one tile remaining.

The issue was that the second tile was created as a sibling of the originally split tile (i.e. 2 tiles both with the root tile as parent), but the root tile's layout wasn't changed. So it remained horizontal and as a result it was saved incorrectly to JSON (2 horizontal tiles with width = 1, instead of 2 vertical tiles with height = 0.5).

When the layout was loaded from the JSON, the second tile was dropped, because it didn't fit.

Here is a video of the issue:

Notice the layoutDirection and widths after saving the layout.

BUG: 506622 (probably the same bug, but the description is too vague).

BUG: 514355 (based on the description it should be the same bug).

Merge request reports

Loading