From d81bd1bb3857cb219103ea673b4f7f9a25db8d78 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 23 Jul 2012 21:59:02 +0200 Subject: [PATCH] bindings: provide a security margin when moving mouse to corner --- rc/bindings.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rc/bindings.lua b/rc/bindings.lua index 3b56020..d497713 100644 --- a/rc/bindings.lua +++ b/rc/bindings.lua @@ -89,10 +89,13 @@ local toggle_urgent = toggle_window(awful.client.urgent.get) -- Move mouse to the top left corner of the currently focused client local function move_mouse() - if client.focus and client.focus.screen == mouse.screen then + local c = client.focus + local margin = 10 + if c and c.screen == mouse.screen then + local cc = c:geometry() local _, x, y = awful.mouse.client.corner(nil, "top_left") - if x and y then - mouse.coords({ x = x, y = y }, true) + if x and y and cc.width > margin * 2 and cc.height > margin * 2 then + mouse.coords({ x = x + margin , y = y + margin }, true) end end end