From 2dba3d30af510a03e2e0bce870b65dad8b763edc Mon Sep 17 00:00:00 2001 From: Yifan Zhu Date: Mon, 15 Jan 2024 22:54:19 -0800 Subject: [PATCH] window: don't use exact comparison for QRectFs With fractional geometries, we can only guarantee that nextMoveResizeGeom eventually is within one unit of currentMoveResizeGeom. BUG: 479786 FIXED-IN: 6.0 --- src/window.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index f5699225a2..9f49d6dc38 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1736,7 +1736,11 @@ void Window::handleInteractiveMoveResize(qreal x, qreal y, qreal x_root, qreal y currentTry.translate(dx, dy); nextMoveResizeGeom = currentTry; - if (nextMoveResizeGeom == currentMoveResizeGeom) { + // sinces nextMoveResizeGeom is fractional, at best it is within 1 unit of currentMoveResizeGeom + if (std::abs(currentMoveResizeGeom.left() - nextMoveResizeGeom.left()) <= 1.0 + && std::abs(currentMoveResizeGeom.right() - nextMoveResizeGeom.right()) <= 1.0 + && std::abs(currentMoveResizeGeom.top() - nextMoveResizeGeom.top()) <= 1.0 + && std::abs(currentMoveResizeGeom.bottom() - nextMoveResizeGeom.bottom()) <= 1.0) { break; // Prevent lockup } }