Address window placing problem on rotation

When changing the workspace size, clients will need to reposition
themselves. This leaves a short amount of time where strutted clients
(e.g. panels) will be floating in the wrong place.

This change makes it so when the area could not be properly calculated,
we ignore these clients until they start giving us proper values again.

This is a bit of a workaround though, it would make sense to implement
client placement more synchronously so we didn't have weird moments
where everything is wrong.

It's mostly prominent on the phone but it happens elsewhere when you
rotate.
This commit is contained in:
Aleix Pol 2020-11-20 21:01:26 +01:00 committed by Aleix Pol Gonzalez
parent 91064cb26a
commit 440555166f

View file

@ -2127,6 +2127,12 @@ void Workspace::updateClientArea(bool force)
continue;
}
QRect r = adjustClientArea(client, desktopArea);
// This happens sometimes when the workspace size changes and the
// struted clients haven't repositioned yet
if (!r.isValid()) {
continue;
}
// sanity check that a strut doesn't exclude a complete screen geometry
// this is a violation to EWMH, as KWin just ignores the strut
for (int i = 0; i < Screens::self()->count(); i++) {