Merge branch 'Plasma/5.12' into Plasma/5.14
This commit is contained in:
commit
8fa1537d6f
1 changed files with 15 additions and 3 deletions
|
@ -1407,6 +1407,9 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
|
|||
int xDiff = widthDiff / 2; // Also move a bit in the direction of the enlarge, allows the
|
||||
int yDiff = heightDiff / 2; // center windows to be enlarged if there is gaps on the side.
|
||||
|
||||
// heightDiff (and yDiff) will be re-computed after each successfull enlargement attempt
|
||||
// so that the error introduced in the window's aspect ratio is minimized
|
||||
|
||||
// Attempt enlarging to the top-right
|
||||
oldRect = *target;
|
||||
target->setRect(target->x() + xDiff,
|
||||
|
@ -1416,8 +1419,11 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
|
|||
);
|
||||
if (isOverlappingAny(w, targets, borderRegion))
|
||||
*target = oldRect;
|
||||
else
|
||||
else {
|
||||
moved = true;
|
||||
heightDiff = heightForWidth(w, target->width() + widthDiff) - target->height();
|
||||
yDiff = heightDiff / 2;
|
||||
}
|
||||
|
||||
// Attempt enlarging to the bottom-right
|
||||
oldRect = *target;
|
||||
|
@ -1429,8 +1435,11 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
|
|||
);
|
||||
if (isOverlappingAny(w, targets, borderRegion))
|
||||
*target = oldRect;
|
||||
else
|
||||
else {
|
||||
moved = true;
|
||||
heightDiff = heightForWidth(w, target->width() + widthDiff) - target->height();
|
||||
yDiff = heightDiff / 2;
|
||||
}
|
||||
|
||||
// Attempt enlarging to the bottom-left
|
||||
oldRect = *target;
|
||||
|
@ -1442,8 +1451,11 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
|
|||
);
|
||||
if (isOverlappingAny(w, targets, borderRegion))
|
||||
*target = oldRect;
|
||||
else
|
||||
else {
|
||||
moved = true;
|
||||
heightDiff = heightForWidth(w, target->width() + widthDiff) - target->height();
|
||||
yDiff = heightDiff / 2;
|
||||
}
|
||||
|
||||
// Attempt enlarging to the top-left
|
||||
oldRect = *target;
|
||||
|
|
Loading…
Reference in a new issue