Attached is a patch that doesn't suck. The previous one forgot
subtracting the border_width before returning the new geometry,
resulting in scary growing clients.

-- 
    $l="\n";$p=q-sub r{rand}sub c{((shift)**2+(shift)**2)<1}while(
    $i++<=$s){$t++if c r,r}die("Gregor Best, 0xDB9F9A7C, ".($t/$s*
    4).$l)-;$s+=ord$$|$_ for split //,$p;srand($s|$$);eval$p;die$@
From 93077febf299afaa4415948ee69ae11aba999f4b Mon Sep 17 00:00:00 2001
From: Gregor Best <[email protected]>
Date: Sun, 20 Mar 2011 22:51:00 +0100
Subject: [PATCH] awful.mouse: fix client snapping

Signed-off-by: Gregor Best <[email protected]>
---
 lib/awful/mouse/init.lua.in |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lib/awful/mouse/init.lua.in b/lib/awful/mouse/init.lua.in
index af6c7b6..9592488 100644
--- a/lib/awful/mouse/init.lua.in
+++ b/lib/awful/mouse/init.lua.in
@@ -110,6 +110,8 @@ function client.snap(c, snap, x, y, fixed_x, fixed_y)
     local c = c or client.focus
     local cur_geom = c:geometry()
     local geom = c:geometry()
+    geom.width = geom.width + (2 * c.border_width)
+    geom.height = geom.height + (2 * c.border_width)
     local edge = "none"
     local edge2 = "none"
     geom.x = x or geom.x
@@ -146,6 +148,9 @@ function client.snap(c, snap, x, y, fixed_x, fixed_y)
     if fixed_x then geom.x = cur_geom.x end
     if fixed_y then geom.y = cur_geom.y end
 
+    geom.width = geom.width - (2 * c.border_width)
+    geom.height = geom.height - (2 * c.border_width)
+
     return geom
 end
 
-- 
1.7.3.4

Attachment: pgp5FF3204r4l.pgp
Description: PGP signature

Reply via email to