From 93386ff08f7097fdd5d5ba7bbdd2be1a141fedf4 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Tue, 10 Feb 2009 22:55:34 +0100 Subject: [PATCH] mouse: only reserve "docking space" along the largest dimension of the window. - This avoids a nasty issue with fullheight toolbars. Signed-off-by: Julien Danjou --- lib/awful/mouse.lua.in | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/awful/mouse.lua.in b/lib/awful/mouse.lua.in index 0c85b7d0f..61e1f6b4f 100644 --- a/lib/awful/mouse.lua.in +++ b/lib/awful/mouse.lua.in @@ -64,22 +64,29 @@ local function snap_outside(g, sg, snap) end local function snap_inside(g, sg, snap) - local edge = "none" + local edgev = 'none' + local edgeh = 'none' if math.abs(g.x) < snap + sg.x and g.x > sg.x then - edge = "left" + edgev = 'left' g.x = sg.x elseif math.abs((sg.x + sg.width) - (g.x + g.width)) < snap then - edge = "right" + edgev = 'right' g.x = sg.x + sg.width - g.width end if math.abs(g.y) < snap + sg.y and g.y > sg.y then - edge = "top" + edgeh = 'top' g.y = sg.y elseif math.abs((sg.y + sg.height) - (g.y + g.height)) < snap then - edge = "bottom" + edgeh = 'bottom' g.y = sg.y + sg.height - g.height end - return g, edge + + -- What is the dominant dimension? + if g.width > g.height then + return g, edgeh + else + return g, edgev + end end --- Snap a client to the closest client or screen edge.