From 78e0ff6b974261aecb3f924a44be89b56db8ae71 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 27 Jan 2023 10:51:26 +0200 Subject: [PATCH] Avoid resizing the tile until interactive resize is actually active It's confusing, but handleInteractiveMoveResize() can be called while interactive move resize is inactive. --- src/window.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index b8ed9997f6..8d93a514b0 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -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]() {