Finally figured out how to reproduce the issue I was having with my special setup. For some reason, it does not occur on KDE neon Developer Edition with a self-compiled KDE Plasma 5.24.6, even without relayout patches applied. However, it does occur on Kubuntu 22.04 with a self-compiled KDE Plasma 5.24.6 with relayout patches applied. I will comment on the bug report, however I believe this is a different though related bug.
This MR is no longer WIP.
This makes use of the layout locking freature introduced in
The resize of the layout area can happen either by screen resolution change or available screen area change (a panel appears or is resized) This is not an atomic operation, as width and height are usually set in 2 different operations, and even worse the layout area is resized to match the available one with an animation, so many intermediate resizes that should never cause a relayout happen. A compression timer limits the actual relayouts to hopefully one, but if the system is really slowed down (for instance, startup) the timer may expire and cause relayouts in non useful sizes, losing the needed configuration The lock blocks all relayout and config writes when the size of the layout area doesn't correspond to corona availablescreenrect, which are the only "settled" cases.