Avoid resizing the tile until interactive resize is actually active

It's confusing, but handleInteractiveMoveResize() can be called while
interactive move resize is inactive.


(cherry picked from commit 78e0ff6b974261aecb3f924a44be89b56db8ae71)
icc-effect-5.27.2
Vlad Zahorodnii 2023-01-27 10:51:26 +02:00
parent a3bf413a0f
commit d53e685504
1 changed files with 6 additions and 5 deletions

View File

@ -1826,15 +1826,11 @@ void Window::handleInteractiveMoveResize(const QPointF &local, const QPointF &gl
void Window::handleInteractiveMoveResize(int x, int y, int x_root, int y_root)
{
const Gravity gravity = interactiveMoveResizeGravity();
if (m_tile && m_tile->supportsResizeGravity(gravity)) {
m_tile->resizeFromGravity(gravity, x_root, y_root);
return;
}
if (isWaitingForInteractiveMoveResizeSync()) {
return; // we're still waiting for the client or the timeout
}
const Gravity gravity = interactiveMoveResizeGravity();
if ((gravity == Gravity::None && !isMovableAcrossScreens())
|| (gravity != Gravity::None && (isShade() || !isResizable()))) {
return;
@ -1897,6 +1893,11 @@ void Window::handleInteractiveMoveResize(int x, int y, int x_root, int y_root)
};
if (isInteractiveResize()) {
if (m_tile && m_tile->supportsResizeGravity(gravity)) {
m_tile->resizeFromGravity(gravity, x_root, y_root);
return;
}
QRectF orig = initialInteractiveMoveResizeGeometry();
SizeMode sizeMode = SizeModeAny;
auto calculateMoveResizeGeom = [&topleft, &bottomright, &orig, &nextMoveResizeGeom, &sizeMode, &gravity]() {