Bug 504367

Summary: Tiling manager doesn't layout only has one "tile"
Product: [Plasma] kwin Reporter: Jonathan Isom <jeisom>
Component: Custom TilingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, notmart
Priority: NOR    
Version First Reported In: 6.3.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.4.0
Sentry Crash Report:

Description Jonathan Isom 2025-05-16 23:58:31 UTC
SUMMARY
I set a desktop to 1 tile as a quicker method than dragging to the top and hit doesn't expand on a specific desktop. This is the tiling with shift key. Also has flicker in this situation that doesn't occur during 2+ tiles.

STEPS TO REPRODUCE
1. Meta-T and delete extra tiles
2. Hold shift while moving window and release left button.


OBSERVED RESULT
Flicker with no expansion to fill tile.




EXPECTED RESULT


SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.90
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.6-273-linux-tkg (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 64 GiB of RAM (62.7 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 4080
Product Name: X570M Pro4
Comment 1 Vlad Zahorodnii 2025-05-19 07:19:31 UTC
This also happens in 6.3, right?
Comment 2 Bug Janitor Service 2025-05-19 08:03:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7632
Comment 3 Vlad Zahorodnii 2025-05-19 08:47:09 UTC
Git commit 9b0fd06e14e30c8fa39271fe6b1c0faaee381588 by Vlad Zahorodnii.
Committed on 19/05/2025 at 08:33.
Pushed by vladz into branch 'master'.

tiles: Fix CustomTile::remove() collapsing tile tree too much

When a tile is removed and its sibling is empty, the parent tile will
be converted in a leaf tile.

The problem is that CustomTile::remove() can attempt to convert the
root tile in a leaf tile, but we expect the root tile to contain at
least one child at all times.

This change adds a relevant guard. Note that CustomTile::remove() can
be still used to purge all children of the RootTile. This is mainly
used by the tiles editor. Window::quickTileGeometry() was also adjusted
so it doesn't report a misleading geometry if the window can't be
custom tiled.

M  +1    -1    src/tiles/customtile.cpp
M  +5    -0    src/tiles/tile.cpp
M  +1    -0    src/tiles/tile.h
M  +2    -0    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/9b0fd06e14e30c8fa39271fe6b1c0faaee381588
Comment 4 Vlad Zahorodnii 2025-05-19 08:59:52 UTC
Git commit 613a1afbff4b44a0b8c8ad41bdc8bbd484ff4872 by Vlad Zahorodnii.
Committed on 19/05/2025 at 08:47.
Pushed by vladz into branch 'Plasma/6.4'.

tiles: Fix CustomTile::remove() collapsing tile tree too much

When a tile is removed and its sibling is empty, the parent tile will
be converted in a leaf tile.

The problem is that CustomTile::remove() can attempt to convert the
root tile in a leaf tile, but we expect the root tile to contain at
least one child at all times.

This change adds a relevant guard. Note that CustomTile::remove() can
be still used to purge all children of the RootTile. This is mainly
used by the tiles editor. Window::quickTileGeometry() was also adjusted
so it doesn't report a misleading geometry if the window can't be
custom tiled.


(cherry picked from commit 9b0fd06e14e30c8fa39271fe6b1c0faaee381588)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +1    -1    src/tiles/customtile.cpp
M  +5    -0    src/tiles/tile.cpp
M  +1    -0    src/tiles/tile.h
M  +2    -0    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/613a1afbff4b44a0b8c8ad41bdc8bbd484ff4872