Avoid resizing the tile until interactive resize is actually active

It's confusing, but handleInteractiveMoveResize() can be called while
interactive move resize is inactive.
This commit is contained in:
Vlad Zahorodnii 2023-01-27 10:51:26 +02:00
parent b712c26457
commit 78e0ff6b97

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]() {