Merge branch 'Plasma/5.12' into Plasma/5.14

This commit is contained in:
Vlad Zagorodniy 2018-10-29 00:02:52 +02:00
commit 8fa1537d6f

View file

@ -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 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. 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 // Attempt enlarging to the top-right
oldRect = *target; oldRect = *target;
target->setRect(target->x() + xDiff, target->setRect(target->x() + xDiff,
@ -1416,8 +1419,11 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
); );
if (isOverlappingAny(w, targets, borderRegion)) if (isOverlappingAny(w, targets, borderRegion))
*target = oldRect; *target = oldRect;
else else {
moved = true; moved = true;
heightDiff = heightForWidth(w, target->width() + widthDiff) - target->height();
yDiff = heightDiff / 2;
}
// Attempt enlarging to the bottom-right // Attempt enlarging to the bottom-right
oldRect = *target; oldRect = *target;
@ -1429,8 +1435,11 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
); );
if (isOverlappingAny(w, targets, borderRegion)) if (isOverlappingAny(w, targets, borderRegion))
*target = oldRect; *target = oldRect;
else else {
moved = true; moved = true;
heightDiff = heightForWidth(w, target->width() + widthDiff) - target->height();
yDiff = heightDiff / 2;
}
// Attempt enlarging to the bottom-left // Attempt enlarging to the bottom-left
oldRect = *target; oldRect = *target;
@ -1442,8 +1451,11 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural(EffectWindowLis
); );
if (isOverlappingAny(w, targets, borderRegion)) if (isOverlappingAny(w, targets, borderRegion))
*target = oldRect; *target = oldRect;
else else {
moved = true; moved = true;
heightDiff = heightForWidth(w, target->width() + widthDiff) - target->height();
yDiff = heightDiff / 2;
}
// Attempt enlarging to the top-left // Attempt enlarging to the top-left
oldRect = *target; oldRect = *target;