From 725534471e183b29d8f3de46272a1a9470a97789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 19 Jun 2013 21:28:21 +0200 Subject: [PATCH] exclude padding from snap delta of screen snap using the actual delta this casewise causes false preference for window snapping (less to move) this restores the pre snap-to-content behavior in that regard and delta isn't used for anything else. BUG: 321325 FIXED-IN: 4.11 REVIEW: 111139 --- geometry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index becb4dc02b..4be414cb60 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -433,20 +433,20 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted, padding[3] = 0; if ((sOWO ? (cx < xmin) : true) && (qAbs(xmin - cx) < snapX)) { - deltaX = xmin - (cx - padding[0]); + deltaX = xmin - cx; nx = xmin - padding[0]; } if ((sOWO ? (rx > xmax) : true) && (qAbs(rx - xmax) < snapX) && (qAbs(xmax - rx) < deltaX)) { - deltaX = rx + padding[1] - xmax; + deltaX = rx - xmax; nx = xmax - cw + padding[1]; } if ((sOWO ? (cy < ymin) : true) && (qAbs(ymin - cy) < snapY)) { - deltaY = ymin - (cy - padding[2]); + deltaY = ymin - cy; ny = ymin - padding[2]; } if ((sOWO ? (ry > ymax) : true) && (qAbs(ry - ymax) < snapY) && (qAbs(ymax - ry) < deltaY)) { - deltaY = ry + padding[3] - ymax; + deltaY = ry - ymax; ny = ymax - ch + padding[3]; } }